Skip to content

Commit

Permalink
feat: add version specific distribution tag for previous major versio…
Browse files Browse the repository at this point in the history
…n, so it will not use "latest"
  • Loading branch information
oliverschuerch committed Dec 19, 2024
1 parent 85297d3 commit a8b7df9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,22 @@ jobs:
token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }}
ref: ${{ fromJSON(needs.collect-release-data.outputs.release-data).tagName }}

- name: Add distribution tag for old major version
uses: actions/github-script@v7
with:
script: |
const fs = require('fs')
const release = ${{ needs.collect-release-data.outputs.release-data }}
const rootPkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
const changesetPublishScript = rootPkg.scripts?.['changeset:publish']
const hasTag = /^.* --tag v[\d]+$/.test(changesetPublishScript)
if (changesetPublishScript && !hasTag) {
rootPkg.scripts['changeset:publish'] = `${changesetPublishScript} --tag v${release.old.major}`
fs.writeFileSync('./package.json', JSON.stringify(rootPkg, null, 2) + '\n')
}
- name: Remove Documentation versions.json
run: rm -f ./packages/documentation/public/assets/versions.json

Expand Down

0 comments on commit a8b7df9

Please sign in to comment.