update ci workflow to fetch with history to collect changes #34
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
ci: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: π Setup node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: π¦ Install | |
run: npm ci | |
- name: π§βπ« Check Format | |
run: npm run format | |
- name: π΅οΈ Lint | |
run: npm run lint | |
- name: π·ββοΈ Build | |
run: npm run build | |
- name: π¦ Create Release Package | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
id: package | |
run: zip -r dist.zip dist | |
- name: π Collect Changes | |
if: ${{ steps.package.outcome == 'success' }} | |
id: changes | |
uses: simbo/changes-between-tags-action@v1 | |
- name: π Create GitHub Release | |
if: ${{ steps.package.outcome == 'success' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Release ${{ steps.changes.outputs.tag }} | |
body: ${{ steps.changes.outputs.changes }} | |
artifacts: dist.zip | |
# - name: π Deploy to GitHub Pages | |
# if: ${{ steps.package.outcome == 'success' }} | |
# uses: JamesIves/github-pages-deploy-action@v4 | |
# with: | |
# folder: dist | |
# commit-message: Release ${{ github.ref_name }} from main @ ${{ github.sha }} |