mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
81 lines
1.7 KiB
YAML
81 lines
1.7 KiB
YAML
name: release
|
|
|
|
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
|
|
|
|
gh-pages:
|
|
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
|
|
|
|
- name: build
|
|
env:
|
|
PUBLIC_PATH: '/metacubexd'
|
|
run: |
|
|
pnpm install
|
|
pnpm build
|
|
|
|
- name: Publish Github Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./dist
|
|
|
|
release:
|
|
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
|
|
|
|
- name: build
|
|
run: |
|
|
pnpm install
|
|
pnpm build
|
|
|
|
- name: attach release artifacts
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: dist/**
|
|
tag_name: ${{ needs.release-please.outputs.tag_name }}
|