Skip to content

Commit

Permalink
Merge pull request #133 from onfido/update-release-notes
Browse files Browse the repository at this point in the history
Update CHANGELOG and integrate onfido-action for CHANGELOG generation
  • Loading branch information
dvacca-onfido authored Jul 1, 2024
2 parents c429b21 + 5bc7a74 commit c4397b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
34 changes: 5 additions & 29 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,50 +58,26 @@ jobs:

publish-npm:
runs-on: ubuntu-latest

needs: integration-tests
environment: delivery
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }}
ref: ${{ github.ref_name }}
- uses: actions/setup-node@v4
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
- name: Validate release
uses: onfido/onfido-actions/release-check@main
- name: Install dependencies
run: npm ci
- name: Build and publish package
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- name: Update CHANGELOG.md
run: |
TMP_FILE=$(mktemp)
RELEASE_VERSION=$(jq -r '.release' .release.json)
RELEASE_DATE=`date +'%dth %B %Y' | sed -E 's/^0//;s/^([2,3]?)1th/\11st/;s/^([2]?)2th/\12nd/;s/^([2]?)3th/\13rd/'`
SPEC_COMMIT_SHA=$(jq -r '.source.short_sha' .release.json)
SPEC_COMMIT_URL=$(jq -r '.source.repo_url + "/commit/" + .source.long_sha' .release.json)
SPEC_RELEASE_VERSION=$(jq -r '.source.version' .release.json)
SPEC_RELEASE_URL=$(jq -r '.source.repo_url + "/releases/tag/" + .source.version' .release.json)
echo -e "# Changelog\n\n## $RELEASE_VERSION $RELEASE_DATE\n\n" >| $TMP_FILE
echo -en "${{ github.event.release.body }}\nBased on Onfido OpenAPI spec " >> $TMP_FILE
if [ -z $SPEC_RELEASE_VERSION ]; then
echo "up to commit [$SPEC_COMMIT_SHA](${SPEC_COMMIT_URL})." >> $TMP_FILE
else
echo "version [$SPEC_RELEASE_VERSION](${SPEC_RELEASE_URL})." >> $TMP_FILE
fi
grep -v "^# Changelog" CHANGELOG.md >> $TMP_FILE
mv $TMP_FILE CHANGELOG.md
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git commit -m "Update CHANGELOG.md after library release" CHANGELOG.md
git push
- name: Update and commit CHANGELOG.md
uses: onfido/onfido-actions/update-changelog@main
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v3.1.0 24th June 2024

- Library has been updated and automatically generated from [Onfido OpenAPI Spec](https://github.com/onfido/onfido-openapi-spec) (release [v3.0.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.0.0))
- Integration tests have been refreshed and API coverage increased

## v3.0.0 6th May 2024 (pre-release)

- Make library auto-generated and based on [Onfido OpenAPI spec](https://github.com/onfido/onfido-openapi-spec)
Expand Down

0 comments on commit c4397b8

Please sign in to comment.