-
Notifications
You must be signed in to change notification settings - Fork 12
62 lines (51 loc) · 1.52 KB
/
release-preview.yml
File metadata and controls
62 lines (51 loc) · 1.52 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
name: Release for Preview Channel
on:
push:
branches:
- main
- 'v[0-9]+.x'
paths:
- 'src/manifest.json'
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
release-preview:
if: "${{ startsWith(github.event.head_commit.message, 'chore: release version') }}"
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Environment setup
uses: ./.github/actions/setup
- name: Build
run: pnpm build --channel=preview
- name: Get built version
uses: actions/github-script@v7
id: version
with:
script: |
const script = require('./.github/actions/get-built-version.cjs')
await script({ github, context, core })
- name: Delete existing release # To keep the workflow idempotent.
run: gh release delete v${{ steps.version.outputs.version }}-preview --cleanup-tag --yes
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
- name: Release
uses: softprops/action-gh-release@v2.4.1
with:
files: |
dist/*.zip
tag_name: v${{ steps.version.outputs.version }}-preview
name: Preview v${{ steps.version.outputs.version }}
prerelease: true
# - name: Upload to stores
# if: github.ref_name == 'main'
# run: |
# echo 'TODO'