2022-12-22 09:25:24 +00:00
|
|
|
name: release-snapshot
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
goreleaser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository and submodules
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Unshallow
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
|
|
|
- name: Setup Go
|
2022-12-22 10:01:50 +00:00
|
|
|
id: go
|
2022-12-22 09:25:24 +00:00
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.18.8
|
|
|
|
|
|
|
|
- name: Locate cache paths
|
|
|
|
id: cache
|
|
|
|
run: |
|
|
|
|
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
# Note: use custom caching because below performs a cross platform build
|
|
|
|
# through goreleaser and don't want to share a cache with the test builds.
|
|
|
|
- name: Setup caching
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.cache.outputs.GOMODCACHE }}
|
|
|
|
${{ steps.cache.outputs.GOCACHE }}
|
2022-12-22 10:01:50 +00:00
|
|
|
key: release-${{ runner.os }}-go-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
2022-12-22 09:25:24 +00:00
|
|
|
|
|
|
|
- name: Run GoReleaser
|
|
|
|
uses: goreleaser/goreleaser-action@v4
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --snapshot
|
|
|
|
|
2022-12-22 10:01:50 +00:00
|
|
|
- name: Upload macOS binaries
|
2022-12-22 09:25:24 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2022-12-22 10:01:50 +00:00
|
|
|
name: bricks_darwin_snapshot
|
|
|
|
path: |
|
|
|
|
dist/bricks_darwin_*
|
|
|
|
|
|
|
|
- name: Upload Linux binaries
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: bricks_linux_snapshot
|
|
|
|
path: |
|
|
|
|
dist/bricks_linux_*
|
|
|
|
|
|
|
|
- name: Upload Windows binaries
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: bricks_windows_snapshot
|
|
|
|
path: |
|
|
|
|
dist/bricks_windows_*
|