Skip to content

Publish release

Publish release #14

Workflow file for this run

name: Publish release
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'publish'
cancel-in-progress: true
jobs:
publish:
name: Publish latest release
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const getLatestRelease = require('./scripts/getLatestRelease.js');
await getLatestRelease({ github, context, core, workspace: "${{ github.workspace }}" });
- name: Validate release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const validateRelease = require('./scripts/validateRelease.js');
await validateRelease({ core });
- name: Extract release artifact
run: |
mkdir -p "${{ github.workspace }}/dist";
tar -C "${{ github.workspace }}/dist" -xzf $RELEASE_ARTIFACT_FILENAME;
chmod -c -R +rX "${{ github.workspace }}/dist" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line";
done;
- name: Build release status
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const buildReleaseStatus = require("./scripts/buildReleaseStatus.js");
await buildReleaseStatus({ path: "${{ github.workspace }}/dist" });
- name: Configure pages
uses: actions/configure-pages@v5
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: "${{ github.workspace }}/dist"
retention-days: 1
- name: Deploy pages
id: deployment
uses: actions/deploy-pages@v4