-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (51 loc) · 1.43 KB
/
release.yaml
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
name: release
permissions:
contents: write
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
release:
name: Package and release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '>=1.17.0'
- name: Install dependencies
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Set version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Package
run: ./ci/build.sh
env:
SEMVER: ${{ env.RELEASE_VERSION }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages
path: dist/*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
draft: true
files: |
./dist/*
- name: Publish
if: startsWith(github.ref, 'refs/tags/') && env.PUBLISH_TOKEN
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
PUBLISH_REPO: ${{ secrets.PUBLISH_REPO }}
PUBLISH_OWNER: ${{ secrets.PUBLISH_OWNER }}
run: |
./ci/publish.sh ./dist --repo "$PUBLISH_REPO" --owner "$PUBLISH_OWNER"