Skip to content

Commit

Permalink
upload artifacts using actions/upload-artifact@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
tmsmr committed Feb 10, 2024
1 parent 570d5b5 commit fb21b28
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,8 @@ jobs:
test:
uses: ./.github/workflows/tests.yml

#release:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Create Release
# uses: actions/create-release@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref_name }}
# release_name: Release ${{ github.ref_name }}
# draft: false
# prerelease: false

build:
#needs: release
needs: release
strategy:
matrix:
goos: [linux, darwin, windows]
Expand All @@ -42,10 +28,15 @@ jobs:
run: CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ steps.binary-name.outputs.K4WD_BIN_NAME }} -ldflags "-s -w" -v ./cmd/k4wd
- name: Store Artifact Name
id: artifact-name
run: echo "K4WD_ART_NAME=k4wd-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.tar.gz' || '.zip' }}" >> $GITHUB_OUTPUT
run: echo "K4WD_ART_NAME=k4wd-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }}" >> $GITHUB_OUTPUT
- name: Create Archive for Linux and MacOS
if: matrix.goos != 'windows'
run: tar -czf ${{ steps.artifact-name.outputs.K4WD_ART_NAME }} ${{ steps.binary-name.outputs.K4WD_BIN_NAME }}
- name: Create Archive for Windows
if: matrix.goos == 'windows'
run: zip ${{ steps.artifact-name.outputs.K4WD_ART_NAME }} ${{ steps.binary-name.outputs.K4WD_BIN_NAME }}
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact-name.outputs.K4WD_ART_NAME }}
path: ${{ steps.artifact-name.outputs.K4WD_ART_NAME }}

0 comments on commit fb21b28

Please sign in to comment.