Skip to content

Commit

Permalink
github: add the windows publish step
Browse files Browse the repository at this point in the history
  • Loading branch information
benburkert committed Apr 14, 2024
1 parent b911bb2 commit 8d6a54e
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}

0 comments on commit 8d6a54e

Please sign in to comment.