This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.42 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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
workflow_dispatch:
pull_request_target:
branches:
- main
- master
types:
- closed
jobs:
release:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Setup node env 🏗
uses: actions/setup-node@v3.6.0
with:
node-version-file: .node-version
cache: yarn
- name: Install dependencies 👨🏻💻
run: yarn
- name: Run package 📦
run: yarn package
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: "minor"
custom_release_rules: "feat:minor:✨ Features,fix:patch:🐛 Fixes,docs:patch:📰 Docs,chore:patch:🎨 Chore,pref:patch:🎈 Performance improvements,refactor:patch:🧹 Refactoring,build:patch:🔍 Build,ci:patch:🔍 CI,revert:patch:⏪ Revert,style:patch:🧹 Style,test:patch:👀 Test"
- name: Replace version
run: |
cat package.json | jq '.version|="${{ steps.tag_version.outputs.new_version }}"'
git diff
- name: Publish release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Create zip
id: create-zip
working-directory: output
run: |
REPO="${GITHUB_REPOSITORY#"${GITHUB_REPOSITORY_OWNER}/"}"
zip -r "${REPO}_${{ steps.tag_version.outputs.new_tag }}.zip" "${REPO}"
echo "zip-path=output/${REPO}-${{ steps.tag_version.outputs.new_tag }}.zip" >> $GITHUB_OUTPUT
echo "zip-filename=${REPO}-${{ steps.tag_version.outputs.new_tag }}.zip" >> $GITHUB_OUTPUT
- name: Upload Release Asset
uses: shogo82148/actions-upload-release-asset@v1.6.4
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.create-zip.outputs.zip-path }}
asset_name: ${{ steps.create-zip.outputs.zip-filename }}
asset_content_type: application/zip