-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.61 KB
/
release.yml
File metadata and controls
64 lines (54 loc) · 1.61 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
60
61
62
63
64
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'WASM version (e.g., 0.0.46.1)'
required: true
t_ruby_version:
description: 't-ruby version (e.g., 0.0.46, defaults to latest)'
required: false
permissions:
contents: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Extract version
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
VERSION="${{ inputs.version }}"
T_RUBY_VERSION="${{ inputs.t_ruby_version }}"
else
VERSION=${GITHUB_REF#refs/tags/v}
T_RUBY_VERSION=""
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "t_ruby_version=$T_RUBY_VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"
- name: Build
run: npm run build
- name: Update version
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
- name: Publish to npm
run: npm publish --access public --provenance
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: "v${{ steps.version.outputs.version }}"
generate_release_notes: true
files: |
dist/*
package.json