Skip to content

Commit

Permalink
update GH action to have separate/per-OS builds before final release …
Browse files Browse the repository at this point in the history
…step
  • Loading branch information
samsullivan committed Jan 18, 2024
1 parent 135a535 commit 33b91a1
Showing 1 changed file with 101 additions and 10 deletions.
111 changes: 101 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,113 @@ permissions:
contents: write

jobs:
goreleaser:

jobs:
build-darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.21.5
- name: Build
uses: goreleaser/goreleaser-action@v5
with:
args: release --skip-publish --config .goreleaser/darwin.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: jqless-darwin
path: dist/jqless*

build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
go-version: 1.21.5
- name: Build
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
args: release --skip-publish --config .goreleaser/linux.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: jqless-linux
path: dist/jqless*

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.21.5
- name: Build
uses: goreleaser/goreleaser-action@v5
with:
args: release --skip-publish --config .goreleaser/windows.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: jqless-windows
path: dist/jqless*

release:
needs: [build-darwin, build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.21.5
- name: Make directory
run: |
mkdir -p ./jqless-build/darwin
mkdir -p ./jqless-build/linux
mkdir -p ./jqless-build/windows
- name: Download darwin binaries
uses: actions/download-artifact@v4
with:
name: jqless-darwin
path: ./jqless-build/darwin
- name: Download linux binaries
uses: actions/download-artifact@v4
with:
name: jqless-linux
path: ./jqless-build/linux
- name: Download windows binaries
uses: actions/download-artifact@v4
with:
name: jqless-windows
path: ./jqless-build/windows
- name: Merge checksum file
run: |
cd ./jqless-build
cat ./darwin/jqless*checksums.txt >> checksums.txt
cat ./linux/jqless*checksums.txt >> checksums.txt
cat ./windows/jqless*checksums.txt >> checksums.txt
rm ./darwin/jqless*checksums.txt
rm ./linux/jqless*checksums.txt
rm ./windows/jqless*checksums.txt
- name: Release
uses: goreleaser/goreleaser-action@v5
with:
args: release --config scripts/.goreleaser/release.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

0 comments on commit 33b91a1

Please sign in to comment.