diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml deleted file mode 100644 index 00e4107..0000000 --- a/.github/workflows/docker-build-push.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Docker Build & Push (Tags Only) - -on: - push: - tags: - - '[0-9]*' # triggers for version tag pushed - -jobs: - build-and-push: - runs-on: ubuntu-latest - - steps: - # Step 1: Check out the repository - - name: Check out code - uses: actions/checkout@v3 - - # Step 2: Log in to Docker Hub - - name: Log in to Docker Hub - run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u meehow --password-stdin - - # Step 3: Build the Docker image - - name: Build Docker image - run: | - docker build -t meehow/privtracker:latest \ - -t meehow/privtracker:${{ github.ref_name }} . - - # Step 4: Push the Docker image - - name: Push Docker image - run: | - docker push meehow/privtracker:latest - docker push meehow/privtracker:${{ github.ref_name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e3dcfd4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + push: + tags: + - '[0-9]*' # triggers for version tag pushed + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: meehow + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: + - meehow/privtracker:latest + - meehow/privtracker:${{ github.ref_name }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 78c707d..a913d1d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -25,6 +25,8 @@ builds: ignore: - goos: windows goarch: arm64 + flags: -trimpath + ldflags: -s -w -buildid= archives: - formats: tar.gz @@ -50,4 +52,4 @@ changelog: filters: exclude: - "^docs:" - - "^test:" + - "_test:"