ci: add automatic changelog generation (#22) #12
Workflow file for this run
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: Publish to pub.dev | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" # tag pattern on pub.dev: 'v{{version}' | |
# Publish using custom workflow | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Add version | |
run: | | |
echo -e "\n\nversion: ${GITHUB_REF_NAME##v}" >> pubspec.yaml | |
- name: Update CHANGELOG | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ secrets.NITRIC_BOT_TOKEN }} | |
fromTag: ${{ github.ref_name }} | |
toTag: v1.0.0 | |
writeToFile: true | |
- name: Check Publish Warnings | |
run: dart pub publish --dry-run | |
- name: Publish | |
uses: k-paxian/[email protected] | |
with: | |
credentialJson: ${{ secrets.CREDENTIAL_JSON }} | |
skipTests: true |