docs: Put docs in the .github folder (#94) #4
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: | |
workflow_dispatch: {} | |
workflow_call: {} | |
push: | |
branches: [main] | |
# Declare default permissions as read only. | |
permissions: | |
contents: read | |
jobs: | |
get-temp-token: | |
uses: ./.github/workflows/get-workflow-token.yaml | |
secrets: inherit | |
semantic-release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
needs: [get-temp-token] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
with: | |
persist-credentials: false | |
- name: Decrypt the installation access token | |
id: decrypt-token | |
run: | | |
DECRYPTED_TOKEN=$(gpg --decrypt --quiet --batch --passphrase "$KEY" \ | |
--output - <(echo "${{ needs.get-temp-token.outputs.temp-token }}" \ | |
| base64 --decode)) | |
echo "::add-mask::$DECRYPTED_TOKEN" | |
echo "temp-token=$DECRYPTED_TOKEN" >> $GITHUB_OUTPUT | |
env: | |
KEY: ${{ secrets.PGP_SECRET_SIGNING_PASSPHRASE }} | |
- name: Create GitHub release and update CHANGELOG | |
id: release | |
uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0 | |
with: | |
semantic_version: 19.0.0 | |
extra_plugins: | | |
@semantic-release/changelog@6.0.0 | |
@semantic-release/git@10.0.0 | |
conventional-changelog-conventionalcommits@5.0.0 | |
env: | |
GITHUB_TOKEN: ${{ steps.decrypt-token.outputs.temp-token }} | |
- name: Summary with release | |
if: ${{ steps.release.outputs.new_release_published == 'true' }} | |
run: | | |
echo "# :white_check_mark: New release published" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "Release bumped from v${{ steps.release.outputs.last_release_version }} to v${{ steps.release.outputs.new_release_version }}" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "## CHANGELOG" >> $GITHUB_STEP_SUMMARY | |
echo "" | |
echo "${{ steps.release.outputs.new_release_notes }}" >>$GITHUB_STEP_SUMMARY | |
- name: Summary without release | |
if: ${{ steps.release.outputs.new_release_published == 'false' }} | |
run: | | |
echo "# :negative_squared_cross_mark: No release published" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "There are no relevant changes, so no new version is released" >> $GITHUB_STEP_SUMMARY |