forked from JeremyHeleine/Photo-Sphere-Viewer
-
-
Notifications
You must be signed in to change notification settings - Fork 686
63 lines (53 loc) · 1.8 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
name: release
run-name: Release ${{ github.ref_name }}
on:
push:
tags:
- '*'
jobs:
release:
if: github.repository == 'mistic100/Photo-Sphere-Viewer'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup
uses: ./.github/workflows/shared/setup
with:
turbo-cache: false
- name: build
run: |
yarn ci:version ${{ github.ref_name }}
yarn ci:build
- name: package
run: |
PREVIOUS_TAG=$(git tag --sort=-committerdate | sed -n '2 p')
echo '📂 prepare'
node ./build/prepare-package.mjs
echo '📦 archive'
(cd dist && zip -r photo-sphere-viewer-${{ github.ref_name }}.zip .)
echo '📄 changelog'
git log --pretty=format:"%s" $PREVIOUS_TAG...${{ github.ref_name }} | node ./build/prepare-changelog.mjs $PREVIOUS_TAG ${{ github.ref_name }}
- name: create release
uses: softprops/action-gh-release@v2
with:
draft: true
body_path: dist/changelog_${{ github.ref_name }}.md
files: dist/photo-sphere-viewer-${{ github.ref_name }}.zip
- name: npm publish
run: |
yarn ci:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_TAG: latest
- name: update issue templates
run: |
git fetch origin main --depth 1
git checkout main
node ./build/update-issue-templates.mjs ${{ github.ref_name }}
git stage .github/ISSUE_TEMPLATE
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git commit -m "chore: add ${{ github.ref_name }} to issue templates"
git push