-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.74 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
name: Release
on:
pull_request_target:
types:
- closed
branches:
- "main"
jobs:
incremental_tag_and_release_build:
if: startsWith(github.head_ref, 'bump/') && github.event.pull_request.merged == true
permissions:
contents: write # for release-drafter/release-drafter to create a github release
pull-requests: write # for release-drafter/release-drafter to add label to PR
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create tag
id: tag
run: |
TAG_NAME=v`npm pkg get version | tr -d '"'`
echo ::set-output name=tag_name::$TAG_NAME
git tag $TAG_NAME
git tag
git push origin $TAG_NAME
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".node-version"
- name: "Install dependencies"
uses: ./.github/actions/dependencies
- name: Build
run: |
pnpm build
zip ${{ github.event.repository.name }}-${{ steps.tag.outputs.tag_name }} dist/* manifest.json
- name: Publish a release
id: release_drafter
uses: release-drafter/release-drafter@v5
with:
publish: true
tag: ${{ steps.tag.outputs.tag_name }}
- name: Upload build
uses: actions/[email protected]
with:
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}-${{ steps.tag.outputs.tag_name }}
asset_name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.tag_name }}.zip
asset_content_type: application/zip