diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 752f62f..316176f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.17.x] - os: [ubuntu-latest, macos-latest, windows-latest] + go-version: [1.21.x] + os: [linux, darwin, windows] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - name: Extract project version @@ -24,11 +24,14 @@ jobs: - name: Extract commit hash id: git_commit run: echo "::set-output name=sha::$(git rev-parse --short HEAD)" + - name: Download dependencies + run: go mod tidy - name: Build run: | env GOOS=${{ matrix.os }} GOARCH=amd64 go build -o colorexp-${{ matrix.os }}-amd64-${{ steps.project_version.outputs.version }}-${{ steps.git_commit.outputs.sha }} colorexp.go - name: Upload artifact - uses: actions/upload-artifact@v2 + if: github.event_name == 'push' + uses: actions/upload-artifact@v4 with: name: colorexp-${{ matrix.os }}-amd64-${{ steps.project_version.outputs.version }}-${{ steps.git_commit.outputs.sha }} path: colorexp-${{ matrix.os }}-amd64-${{ steps.project_version.outputs.version }}-${{ steps.git_commit.outputs.sha }}