Skip to content

Release 5.11.0

Release 5.11.0 #35

Workflow file for this run

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
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: data
id: data
run: |
echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: yarn cache ro
uses: actions/cache/restore@v4
with:
key: yarn-${{ hashFiles('yarn.lock') }}
path: ${{ steps.data.outputs.YARN_CACHE_DIR }}
- name: build
run: |
yarn install --frozen-lockfile
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