chore(deps): lock file maintenance (#298) #52
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: Merge | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'src/**' | |
- 'package-lock.json' | |
- 'package.json' | |
- 'tsconfig.json' | |
- 'action.yml' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
release: | |
name: Release | |
env: | |
TEMP_BRANCH: release-${{ github.run_number }} | |
outputs: | |
tag: ${{ steps.changelog.outputs.tag }} | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Conventional Changelog Update | |
uses: TriPSs/conventional-changelog-action@v5 | |
id: changelog | |
continue-on-error: true | |
with: | |
git-branch: ${{ env.TEMP_BRANCH }} | |
github-token: ${{ github.token }} | |
skip-version-file: 'true' | |
skip-commit: 'true' | |
skip-on-empty: 'true' | |
git-push: 'false' | |
- name: Rebuild and push the dist/ directory | |
if: ${{ steps.changelog.outputs.tag }} | |
run: | | |
npm run dist | |
git diff ./dist | |
git checkout -b ${{ env.TEMP_BRANCH }} | |
git add ./dist --force | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
git add . | |
git commit -m "Rebuild dist/ directory" | |
git push -u origin HEAD:${{ env.TEMP_BRANCH }} | |
- name: Release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
if: ${{ steps.changelog.outputs.tag }} | |
run: | | |
echo "Creating release ${{ steps.changelog.outputs.tag }}" | |
git push origin tag ${{ steps.changelog.outputs.tag }} | |
gh release create ${{ steps.changelog.outputs.tag }} --title ${{ steps.changelog.outputs.tag }} --generate-notes | |
cleanup: | |
name: Cleanup | |
if: always() && ${{ needs.release.outputs.tag }} | |
needs: release | |
env: | |
TEMP_BRANCH: release-${{ github.run_number }} | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cleanup | |
run: git push --delete origin ${{ env.TEMP_BRANCH }} |