-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (56 loc) · 1.63 KB
/
release.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
56
57
58
name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version:
required: true
type: string
description: 'Deploy version without "v" ( ex: *.*.* )'
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version from tag
id: variables
shell: bash
run: |
VERSION=''
if [ "${{ github.event_name }}" = "push" ]; then
VERSION="${GITHUB_REF#refs/tags/v}"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
echo "Invalid event type"
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Check same version
run: |
echo "VERSION=${{ steps.variables.outputs.VERSION }}"
echo "package.json version=$(jq -r '.version' package.json)"
if [ "${{ steps.variables.outputs.VERSION }}" != "$(jq -r '.version' package.json)" ]; then
echo "Version is not same"
exit 1
fi
shell: bash
- run: corepack enable
- name: Setup
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install
run: pnpm i --frozen-lockfile
- name: Build
run: pnpm zip && pnpm zip:firefox
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.variables.outputs.VERSION }}
files: .output/*.zip