forked from hashicorp/terraform-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.17 KB
/
snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Snapshot
on:
schedule:
- cron: '15 5 * * *'
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- name: goreleaser release
uses: goreleaser/goreleaser-action@v3
with:
args: release --rm-dist --skip-sign --snapshot --timeout 2h
- name: artifact naming
id: naming
run: |
case $GITHUB_REF in
refs/heads/*)
ARTIFACT="${GITHUB_REF#refs/heads/}";;
refs/pull/*)
ARTIFACT="pr-${GITHUB_REF#refs/pull/}"
ARTIFACT="${ARTIFACT%/merge}";;
*)
ARTIFACT="${GITHUB_REF}";;
esac
echo "artifact=$ARTIFACT-$(date -u +'%Y-%m-%dT%H-%M')" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v3
with:
name: ${{steps.naming.outputs.artifact}}
path: dist/*.zip