Weekly Release #5
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: Weekly Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 16 * * 6" | |
env: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: Remove version suffix | |
run: | | |
sed -i 's/"version": "\([0-9]\+\.[0-9]\+\.[0-9]\+\)-[0-9]\+",/"version": "\1",/g' package.json | |
- name: Update CHANGELOG.md | |
run: | | |
today=$(date +'%Y-%m-%d') | |
sed -i "s/unreleased/$today/" CHANGELOG.md | |
- name: Commit changes | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -am "release: $(jq -r '.version' package.json)" | |
git push |