Docs: automate changelog creation and update #17
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: release | |
on: | |
push: | |
tags: ["v[0-9].[0-9]+.[0-9]+"] | |
pull_request: | |
branches: "*" | |
permissions: | |
contents: write | |
jobs: | |
build_foxe: | |
name: build_foxe | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "16" | |
- name: Install dependencies | |
run: npm install | |
- name: Package | |
run: npm run package | |
- name: Extract version | |
id: extract_version | |
run: | | |
version=$(node -p "require('./package.json').version") | |
echo "version=$version" >> $GITHUB_ENV | |
- name: Update changelog file | |
run: | | |
yarn commitizen init cz-conventional-changelog --save-dev --save-exact | |
yarn conventional-changelog --preset none -r 0 -i CHANGELOG.md -s | |
- name: Commit and push updated CHANGELOG.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add CHANGELOG.md | |
git commit -m "chore: update changelog for $GITHUB_REF" | |
git push origin docs--automate-changelog-creation | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ASAM OSI Converter ${{ env.version }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: lichtblick.asam-osi-converter-${{ env.version }}.foxe | |
asset_name: lichtblick.asam-osi-converter-${{ env.version }}.foxe | |
asset_content_type: application/octet-stream |