-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 1.77 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
55
56
57
58
59
60
61
62
63
64
65
66
name: Release
run-name: Release version ${{ github.event.inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: "Version to release"
required: true
permissions:
contents: write
env:
BINARY_VERSION: ${{ github.event.inputs.version }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Configure git
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
- name: Checkout
uses: actions/checkout@v4
- name: Check version format
run: |
bin/check-version.pl
- uses: actions/setup-go@v4
with:
go-version-file: "./go.mod"
- name: Build
run: |
bin/build-binaries.sh
- name: Tag
run: |
git tag -a v${{ env.BINARY_VERSION }} -m "Release version ${{ env.BINARY_VERSION }}"
git push origin --tags
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
out/*
tag_name: ${{ env.BINARY_VERSION }}
publish-to-npm:
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version-file: "./.nvmrc"
cache: npm
- name: Download release files
run: |
gh release download ${{ github.event.inputs.version }} --dir out
env:
GH_TOKEN: ${{ github.token }}
- run: bin/build-npm-packages.sh
- name: "Setup npm"
run: "npm config set -- '//registry.npmjs.org/:_authToken' '${{ secrets.NPM_RELEASE_TOKEN }}'"
- run: bin/publish-npm-packages.sh