release #23
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: release | |
on: | |
workflow_dispatch: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
environment: | |
name: semver | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Update Pubspec Version | |
run: | | |
NEW_VERSION=$(git describe --tags --abbrev=0) | |
echo "New version: $NEW_VERSION" | |
sed -i "s/^version: .*/version: $NEW_VERSION/" pubspec.yaml | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add pubspec.yaml | |
git commit -m "ci: update pubspec version to $NEW_VERSION" | |
git push https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/Jiseeeh/u-do-note.git HEAD:main |