-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (46 loc) · 1.43 KB
/
publish.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
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Publish new release
on:
workflow_dispatch:
inputs:
release-type:
type: choice
description: Select the release type
required: true
options:
- patch
- minor
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Publish
run: |
make publish-${{ github.event.inputs.release-type }}
env:
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get last git tag
id: git-tag
run: echo "tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
- name: Generate zip archives
run: |
cd bin/darwin-x64 && zip darwin-x64.zip * && cd -
cd bin/darwin-arm64 && zip darwin-arm64.zip * && cd -
cd bin/linux-x64 && zip linux-x64.zip * && cd -
cd bin/linux-arm64 && zip linux-arm64.zip * && cd -
cd bin/windows-x64 && zip windows-x64.zip * && cd -
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
artifacts: 'bin/**/*.zip'
tag: ${{ steps.git-tag.outputs.tag }}