diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 984a0eb..9af904a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,10 +66,7 @@ jobs: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} release: - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest needs: prepare steps: - name: Checkout @@ -86,17 +83,14 @@ jobs: run: | echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - uses: actions/cache@v4 - if: matrix.os != 'windows-latest' with: path: cmd/anchor/dist/linux key: linux-${{ env.sha_short }} - uses: actions/cache@v4 - if: matrix.os != 'windows-latest' with: path: cmd/anchor/dist/darwin key: darwin-${{ env.sha_short }} - uses: actions/cache@v4 - if: matrix.os == 'windows-latest' with: path: cmd/anchor/dist/windows key: windows-${{ env.sha_short }} @@ -112,5 +106,34 @@ jobs: env: GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }} GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} + publish: + runs-on: windows-latest + needs: release + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Copy Caches + - shell: bash + run: | + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + path: cmd/anchor/dist/windows + key: windows-${{ env.sha_short }} + enableCrossOsArchive: true + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser-pro + version: latest + args: publish + workdir: cmd/anchor + env: + GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }} + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}