Skip to content

Commit

Permalink
ci: acitons workflow_dispatch, and tracking paths
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtcoder17 committed Sep 27, 2024
1 parent 0c47c17 commit e74f846
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release

on:
workflow_dispatch:

push:
tags:
- 'v*'
Expand All @@ -10,6 +12,7 @@ on:

paths:
- "cmd/run/**"
- ".github/**"
- "pkg/**"
- go.* # go.mod, and go.sum
- flake.*
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e74f846

Please sign in to comment.