Skip to content

Commit

Permalink
There are a thousand Hamlets in a thousand people's eyes.
Browse files Browse the repository at this point in the history
  • Loading branch information
xBoyMinemc authored Nov 5, 2024
1 parent 01f8057 commit a310908
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,40 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get the latest commit message
id: get_latest_commit
run: |
latest_commit=$(git log -1 --pretty=format:%s)
echo "latest_commit_message=$latest_commit" >> $GITHUB_ENV
- name: Read changelog
id: read_changelog
run: |
changelog=$(< CHANGELOG.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Set up Node.js
if: startsWith(env.latest_commit_message, 'v')
uses: actions/setup-node@v3
with:
node-version: 'latest'

- name: Install TypeScript
run: npm install typescript@latest

- name: Install dependencies
run: npm i

# - name: tsc build
# run: tsc

# - name: webpack build
# run: webpack

# - name: Build project
# run: node packer.js

# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# files: ./node_modules/*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用 GitHub 提供的 token 进行发布


- name: Upload compressed archive
uses: actions/upload-artifact@v4
- name: npm run build
if: startsWith(env.latest_commit_message, 'v')
run: npm run build

- name: Release
uses: softprops/action-gh-release@v1
# Check if commit message starts with 'v'
if: startsWith(env.latest_commit_message, 'v')
with:
name: my-compressed-archive
path: ./node_modules/


tag_name: ${{ github.ref }}
name: Release ${{ env.latest_commit_message }}
body: ${{ env.CHANGELOG }}
draft: false
prerelease: false
files: build/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a310908

Please sign in to comment.