Skip to content

Commit

Permalink
Create goreleaser.yml
Browse files Browse the repository at this point in the history
Signed-off-by: KhulnaSoft bot <[email protected]>
  • Loading branch information
khulnasoft-bot authored Dec 4, 2024
1 parent 8697ca7 commit aeb8601
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release Tunnel

on:
push:
tags:
- 'v*' # Trigger on version tag push, e.g., v1.0.0

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20' # Specify Go version if needed

- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-go-modules-
- name: Install GoReleaser
run: |
curl -sL https://github.com/goreleaser/goreleaser/releases/download/v1.19.0/goreleaser_Linux_x86_64.tar.gz | tar xz
sudo mv goreleaser /usr/local/bin/
- name: Run GoReleaser
run: |
goreleaser release --rm-dist
upload-artifacts:
needs: build
runs-on: ubuntu-latest
steps:
- name: Upload release artifacts
uses: actions/upload-artifact@v3
with:
name: tunnel-release
path: dist/

docker-push:
needs: build
runs-on: ubuntu-latest
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker images
run: |
docker buildx create --use
docker buildx build --push \
--platform linux/amd64,linux/arm64 \
-t ghcr.io/khulnasoft/tunnel:${{ github.ref }} \
-t docker.io/khulnasoft/tunnel:${{ github.ref }} .

0 comments on commit aeb8601

Please sign in to comment.