[Badge Giver] Update v1.2.5.18 #22
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: Auto Release on File Changes | |
on: | |
push: | |
paths: | |
- 'index.js' | |
- 'package.json' | |
- 'start_windows.bat' | |
- 'start_linux.sh' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm install | |
- name: Get version from package.json | |
id: get_version | |
run: | | |
echo "Getting version..." | |
version=$(node -p "require('./package.json').version") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
# Print the value of VERSION for debugging | |
- name: Print VERSION | |
run: echo "VERSION=${{ env.VERSION }}" | |
- name: Zip changed files | |
run: | | |
zip -r BadgeGiver-v${{ env.VERSION }}.zip index.js package.json start_windows.bat start_linux.sh | |
- name: Get commit message | |
id: get_commit_message | |
run: | | |
COMMIT_MSG=$(git log --format=%b -n 1 ${{ github.sha }} | sed ':a;N;$!ba;s/\n/\ /g') | |
echo "COMMIT_MSG=\"$COMMIT_MSG\"" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v0.1.15 | |
with: | |
files: | | |
BadgeGiver-v${{ env.VERSION }}.zip | |
tag_name: v${{ env.VERSION }} | |
name: "Update v${{ env.VERSION }}" | |
body: ${{ env.COMMIT_MSG }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
discussions: write |