Sync with upstream to get latest updates from OpenTermsArchive/terms-types v.1.4.0 #1
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: | |
pull_request_target: | |
branches: [ main, test-main ] | |
types: [ closed ] | |
jobs: | |
changelog: | |
uses: ./.github/workflows/changelog.yml | |
test: | |
uses: ./.github/workflows/test.yml | |
release: | |
if: github.event.pull_request.merged == true | |
needs: [ changelog, test ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update changelog | |
id: update-changelog | |
uses: OpenTermsArchive/changelog-action/[email protected] | |
- name: Update package version | |
run: npm --no-git-tag-version --allow-same-version version ${{ steps.update-changelog.outputs.version }} | |
- name: Update repository | |
run: | | |
git config user.name "Open Terms Archive Release Bot" | |
git config user.email "[email protected]" | |
git commit --message="Update changelog" CHANGELOG.md package.json package-lock.json | |
- name: Run status checks for release commit on temporary branch # use temporary branch to enable pushing commits to this branch protected by required status checks | |
uses: CasperWA/[email protected] # 2.16 minimum is required to benefit from updated defaults | |
with: | |
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} | |
branch: ${{ github.base_ref }} | |
interval: 10 # seconds between checks | |
pre_sleep: 15 | |
fail_fast: true | |
- name: Publish Git tag | |
if: needs.changelog.outputs.release-type != 'no-release' | |
run: | | |
git tag v${{ steps.update-changelog.outputs.version }} | |
git push --tags | |
- name: Publish to NPM public repository | |
if: needs.changelog.outputs.release-type != 'no-release' | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPMJS_ACCESS_TOKEN }} | |
dry-run: ${{ github.base_ref != 'main' }} | |
- name: Publish GitHub release | |
if: needs.changelog.outputs.release-type != 'no-release' | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.update-changelog.outputs.version }} | |
body: ${{ steps.update-changelog.outputs.content }} | |
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} |