From e74f846a720ccf4362b94cee576952cd1e8b7f54 Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Fri, 27 Sep 2024 21:43:11 +0530 Subject: [PATCH] ci: acitons workflow_dispatch, and tracking paths --- .github/workflows/release.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 369bd34..1baf7c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: Release on: + workflow_dispatch: + push: tags: - 'v*' @@ -10,6 +12,7 @@ on: paths: - "cmd/run/**" + - ".github/**" - "pkg/**" - go.* # go.mod, and go.sum - flake.* @@ -47,12 +50,9 @@ jobs: - uses: nxtcoder17/actions/setup-cache-go@v1 with: - cache_key: "run" + cache_key: "run-${{ matrix.platform }}-${{ matrix.arch }}" working_directory: . - # it will set 2 env variables - # IMAGE_TAG - image tag - # OVERRIDE_PUSHED_IMAGE - if true, it will not use pushed image tag - uses: nxtcoder17/actions/generate-image-tag@v1 - uses: nxtcoder17/actions/setup-nix-cachix@v1 @@ -70,11 +70,9 @@ jobs: binary=bin/run-${{ matrix.platform }}-${{ matrix.arch }} go build -o $binary -ldflags="-s -w" -tags urfave_cli_no_docs cmd/run/main.go - - name: compress binary with upx (on linux) - if: matrix.platform == 'linux' - shell: bash - run: |+ - upx $binary + if [ "${{ matrix.platform }}" = "linux" ]; then + upx $binary + fi - name: Upload Artifact uses: actions/upload-artifact@v4 @@ -113,7 +111,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: |+ - set -e + set +e gh release list -R ${{ github.repository }} | grep -i $IMAGE_TAG exit_code=$1 if [ $exit_code -ne 0 ]; then