Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 72 additions & 78 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
name: Release

on:
pull_request_target:
branches:
- main
types: [ closed ]
push:

permissions:
id-token: write # Required for OIDC. See https://docs.npmjs.com/trusted-publishers#step-2-configure-your-cicd-workflow
contents: read

jobs:
changelog:
uses: "./.github/workflows/changelog.yml"
test:
uses: "OpenTermsArchive/engine/.github/workflows/test.yml@main"
# changelog:
# uses: "./.github/workflows/changelog.yml"
# test:
# uses: "OpenTermsArchive/engine/.github/workflows/test.yml@main"
release:
needs: [ changelog, test ]
if: github.event.pull_request.merged == true && needs.changelog.outputs.release-type != 'no-release'
# needs: [ changelog, test ]
# if: github.event.pull_request.merged == true && needs.changelog.outputs.release-type != 'no-release'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -30,75 +27,72 @@ jobs:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- name: Configure Git author
run: |
git config --global user.name "Open Terms Archive Release Bot"
git config --global user.email "release-bot@opentermsarchive.org"

- name: Update changelog for release
id: release-changelog
uses: OpenTermsArchive/changelog-action/release@v0.2.0

- name: Bump package version
run: npm --no-git-tag-version version ${{ steps.release-changelog.outputs.version }}

- name: Commit CHANGELOG.md and package.json changes and create tag
run: |
git add "package.json"
git add "package-lock.json"
git add "CHANGELOG.md"
git commit -m "Release v${{ steps.release-changelog.outputs.version }}"
git tag v${{ steps.release-changelog.outputs.version }}

- 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/push-protected@v2
with:
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
branch: main
unprotect_reviews: true

- name: Update npm
run: npm install -g npm@latest
# - name: Configure Git author
# run: |
# git config --global user.name "Open Terms Archive Release Bot"
# git config --global user.email "release-bot@opentermsarchive.org"

# - name: Update changelog for release
# id: release-changelog
# uses: OpenTermsArchive/changelog-action/release@v0.2.0

# - name: Bump package version
# run: npm --no-git-tag-version version ${{ steps.release-changelog.outputs.version }}

# - name: Commit CHANGELOG.md and package.json changes and create tag
# run: |
# git add "package.json"
# git add "package-lock.json"
# git add "CHANGELOG.md"
# git commit -m "Release v${{ steps.release-changelog.outputs.version }}"
# git tag v${{ steps.release-changelog.outputs.version }}

# - 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/push-protected@v2
# with:
# token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
# branch: main
# unprotect_reviews: true

- name: Publish to NPM public repository
run: npm publish --provenance

- name: Push changes to repository
run: git push origin && git push --tags

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.release-changelog.outputs.version }}
body: ${{ steps.release-changelog.outputs.content }}
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}

- name: Trigger documentation deploy
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TRIGGER_DOCS_DEPLOY_TOKEN }}
event-type: engine-release
repository: OpenTermsArchive/docs
client-payload: '{"version": "v${{ steps.release-changelog.outputs.version }}"}'

clean_changelog:
if: github.event.pull_request.merged == true && needs.changelog.outputs.release-type == 'no-release'
needs: [ changelog ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}

- name: Configure Git author
run: |
git config --global user.name "Open Terms Archive Release Bot"
git config --global user.email "release-bot@opentermsarchive.org"

- name: Update changelog for release
uses: OpenTermsArchive/changelog-action/release@v0.2.0

- name: Save changelog
run: |
git commit -m "Clean changelog" CHANGELOG.md
git push origin
# - name: Push changes to repository
# run: git push origin && git push --tags

# - name: Create GitHub release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: v${{ steps.release-changelog.outputs.version }}
# body: ${{ steps.release-changelog.outputs.content }}
# token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}

# - name: Trigger documentation deploy
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ secrets.TRIGGER_DOCS_DEPLOY_TOKEN }}
# event-type: engine-release
# repository: OpenTermsArchive/docs
# client-payload: '{"version": "v${{ steps.release-changelog.outputs.version }}"}'

# clean_changelog:
# if: github.event.pull_request.merged == true && needs.changelog.outputs.release-type == 'no-release'
# needs: [ changelog ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}

# - name: Configure Git author
# run: |
# git config --global user.name "Open Terms Archive Release Bot"
# git config --global user.email "release-bot@opentermsarchive.org"

# - name: Update changelog for release
# uses: OpenTermsArchive/changelog-action/release@v0.2.0

# - name: Save changelog
# run: |
# git commit -m "Clean changelog" CHANGELOG.md
# git push origin
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased [no-release]

_Modifications made in this changeset do not add, remove or alter any behavior, dependency, API or functionality of the software. They only change non-functional parts of the repository, such as the README file or CI workflows._

## 10.1.3 - 2026-01-06

_Full changeset and discussions: [#1217](https://github.com/OpenTermsArchive/engine/pull/1217)._
Expand Down
Loading