-
Notifications
You must be signed in to change notification settings - Fork 30
59 lines (49 loc) · 1.55 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (49 loc) · 1.55 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: goreleaser
on:
pull_request:
push:
tags:
- "*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: go-setup
uses: actions/setup-go@v6
with:
go-version: 1.24
- name: install snapcraft
uses: lucassabreu/action-snapcraft@main
- name: install nix
uses: cachix/install-nix-action@v31
- name: goreleaser-setup
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
install-only: true
- if: startsWith(github.ref, 'refs/tags/')
name: release a new version
run: |
make release "tag=${GITHUB_REF#refs/tags/}"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_GORELEASER }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
- if: startsWith(github.ref, 'refs/tags/') == false
name: test releasing a snapshot version
run: make release SNAPSHOT=1 tag=Unreleased
- if: startsWith(github.ref, 'refs/tags/')
name: trigger Netlify deploy with new release
run: |
curl -vs "https://api.netlify.com/build_hooks/${NETLIFY_HOOK}" \
--data-urlencode "trigger_title=triggered+by github actions (tag: ${GITHUB_REF#refs/tags/})" \
--data-urlencode "trigger_branch=main" \
-d '{}'
env:
NETLIFY_HOOK: ${{ vars.NETLIFY_HOOK }}