2023-08-27 23:42:27 +08:00
|
|
|
name: release
|
|
|
|
|
2023-08-27 23:38:13 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: main
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release-please:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
|
|
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: release-please
|
|
|
|
id: release
|
|
|
|
uses: google-github-actions/release-please-action@v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
release-type: node
|
|
|
|
|
2023-08-28 00:55:08 +08:00
|
|
|
release:
|
2023-08-27 23:38:13 +08:00
|
|
|
needs: release-please
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ needs.release-please.outputs.release_created }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: pnpm
|
|
|
|
node-version: latest
|
|
|
|
|
2023-08-28 00:55:08 +08:00
|
|
|
- name: install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: build for gh-pages
|
2023-08-29 14:44:49 +08:00
|
|
|
run: pnpm build --base /metacubexd
|
2023-08-27 23:38:13 +08:00
|
|
|
|
2023-08-28 00:55:08 +08:00
|
|
|
- name: publish github pages
|
2023-08-27 23:42:27 +08:00
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./dist
|
2023-08-27 23:51:13 +08:00
|
|
|
|
2023-08-28 00:55:08 +08:00
|
|
|
- name: build for release
|
|
|
|
run: pnpm build
|
2023-08-27 23:51:13 +08:00
|
|
|
|
2023-08-27 23:58:51 +08:00
|
|
|
- name: zip
|
|
|
|
run: |
|
|
|
|
zip -r ../dist.zip .
|
|
|
|
working-directory: dist
|
|
|
|
|
2023-08-27 23:51:13 +08:00
|
|
|
- name: attach release artifacts
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2023-08-27 23:58:51 +08:00
|
|
|
files: dist.zip
|
2023-08-27 23:51:13 +08:00
|
|
|
tag_name: ${{ needs.release-please.outputs.tag_name }}
|