diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 59d9389b4b..85eea217d7 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -111,6 +111,27 @@ jobs: timeout: "10m0s" - name: cosign-installer uses: sigstore/cosign-installer@v3.0.3 + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Install GitHub CLI + run: | + npm install -g github-cli + gh --version + - name: Get Markdown file + id: file-url + env: + GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} + run: | + gh repo view ballerina-platform/ballerina-dev-website --json url --jq '.clone_url' + gh api repos/ballerina-platform/ballerina-dev-website/contents/downloads/verification-notes/verification_notes_template.md -H 'Accept: application/vnd.github.v3.raw' > release_notes.md + - name: Update Markdown file + run: | + npm install + node docs/update-version-notes/update_version.js + env: + NEW_VERSION: ${{ steps.version-set.outputs.taggedVersion }} - name: Read release notes from file id: release_notes uses: actions/github-script@v4 @@ -118,7 +139,7 @@ jobs: github-token: ${{ secrets.BALLERINA_BOT_TOKEN }} script: | const fs = require('fs'); - const releaseNotes = fs.readFileSync('docs/release_notes.md', 'utf8'); + const releaseNotes = fs.readFileSync('release_notes.md', 'utf8'); core.setOutput('notes', releaseNotes); - name: Create release id: create_release diff --git a/docs/release_notes.md b/docs/release_notes.md deleted file mode 100644 index a7443a718c..0000000000 --- a/docs/release_notes.md +++ /dev/null @@ -1,35 +0,0 @@ -# Official Ballerina 2201.7.0 Release Artifacts - - -## Linux - -- **[ballerina-2201.7.0-swan-lake-linux-x64.deb](https://github.com/ballerina-platform/ballerina-distribution/releases/download/v2201.7.0/ballerina-2201.7.0-swan-lake-linux-x64.deb)** -- **[ballerina-2201.7.0-swan-lake-linux-x64.rpm](https://github.com/ballerina-platform/ballerina-distribution/releases/download/v2201.7.0/ballerina-2201.7.0-swan-lake-linux-x64.rpm)** - - -## MacOS - -- **[ballerina-2201.7.0-swan-lake-macos-x64.pkg](https://github.com/ballerina-platform/ballerina-distribution/releases/download/v2201.7.0/ballerina-2201.7.0-swan-lake-macos-x64.pkg)** - -## MacOS-ARM - -- **[ballerina-2201.7.0-swan-lake-macos-arm-x64.pkg](https://github.com/ballerina-platform/ballerina-distribution/releases/download/v2201.7.0/ballerina-2201.7.0-swan-lake-macos-arm-x64.pkg)** - -## Windows - -- **[ballerina-2201.7.0-swan-lake-windows-x64.msi](https://github.com/ballerina-platform/ballerina-distribution/releases/download/v2201.7.0/ballerina-2201.7.0-swan-lake-windows-x64.msi)** - - -For more builds across platforms and architectures see the `Assets` section below. - - -## Signatures and Verification - -`Ballerina` uses [sigstore/cosign](https://github.com/sigstore/cosign) for signing and verifying the release artifacts. - - -Below is an example of using `cosign` to verify the release artifact: - -``` -cosign verify-blob ballerina-2201.7.0-swan-lake-linux-x64.deb --certificate ballerina-2201.7.0-swan-lake-linux-x64.deb.pem --signature ballerina-2201.7.0-swan-lake-linux-x64.deb.sig --certificate-identity=https://github.com/ballerina-platform/ballerina-distribution/.github/workflows/publish-release.yml@refs/heads/master --certificate-oidc-issuer=https://token.actions.githubusercontent.com -``` diff --git a/docs/update-version-notes/update_version.js b/docs/update-version-notes/update_version.js new file mode 100644 index 0000000000..850f46b075 --- /dev/null +++ b/docs/update-version-notes/update_version.js @@ -0,0 +1,23 @@ +const fs = require('fs'); + +const markdownFile = 'release_notes.md'; +const versionPlaceholder = '{{ version }}'; +const newVersion = process.env.NEW_VERSION; + +fs.readFile(markdownFile, 'utf8', (err, data) => { + if (err) { + console.error(err); + return; + } + + const updatedContent = data.replace(new RegExp(versionPlaceholder, 'g'), newVersion); + + fs.writeFile(markdownFile, updatedContent, 'utf8', (err) => { + if (err) { + console.error(err); + return; + } + + console.log('Markdown file updated successfully!'); + }); +});