Skip to content

Commit

Permalink
test artifact compression
Browse files Browse the repository at this point in the history
  • Loading branch information
tmsmr committed Feb 10, 2024
1 parent 1ca65fd commit 101616b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ jobs:
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Define Artifact Name
- name: Binary Name
id: binary-name
run: echo "K4WD_BIN_NAME=k4wd-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }}" >> $GITHUB_OUTPUT
- name: Build Binary
run: CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ steps.artifact-name.outputs.K4WD_BIN_NAME }} -ldflags "-s -w" -v ./cmd/k4wd
- name: Artifact Name
id: artifact-name
run: echo "K4WD_ARTIFACT_NAME=k4wd-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }}" >> $GITHUB_OUTPUT
- name: Echo artifact name
run: echo ${{ steps.artifact-name.outputs.K4WD_ARTIFACT_NAME }}
#- name: Build k4wd
# run: CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o k4wd-${{ matrix.goos }}-${{ matrix.goarch }} -ldflags "-s -w" -v ./cmd/k4wd
run: echo "K4WD_ART_NAME=k4wd-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.tar.gz' || '.zip' }}" >> $GITHUB_OUTPUT
- name: Archive Binary
run: |
if [ "${{ matrix.goos }}" = "windows" ]; then
zip ${{ steps.artifact-name.outputs.K4WD_ART_NAME }} ${{ steps.artifact-name.outputs.K4WD_BIN_NAME }}
else
tar -czf ${{ steps.artifact-name.outputs.K4WD_ART_NAME }} ${{ steps.artifact-name.outputs.K4WD_BIN_NAME }}
fi

0 comments on commit 101616b

Please sign in to comment.