V2.3.0 #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: ["master"] | |
types: [closed] | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
run_install: true | |
version: 8.6.6 | |
- name: Build for production | |
run: pnpm run build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-dist | |
path: dist | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-dist | |
path: dist | |
- name: Zip File | |
run: zip -r dist.zip dist | |
- name: Create Tag | |
id: create_tag | |
uses: jaywcjlove/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
package-path: ./package.json | |
- name: Generate Changelog | |
id: changelog | |
uses: jaywcjlove/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
head-ref: ${{steps.create_tag.outputs.version}} | |
filter-author: (andyjjrt|Andy Hung|dependabot\[bot\]|Renovate Bot) | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
if: steps.create_tag.outputs.successful | |
with: | |
name: ${{ steps.create_tag.outputs.version }} | |
tag: ${{ steps.create_tag.outputs.version }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "./dist.zip" | |
body: | | |
${{ steps.changelog.outputs.compareurl }} | |
${{ steps.changelog.outputs.changelog }} |