Version 0.10.0 #20
Workflow file for this run
This file contains hidden or 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 Creation | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| node_version: 18 | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: setup bun | |
| uses: oven-sh/setup-bun@v1 | |
| - name: install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: lint | |
| run: bun run lint | |
| - name: check types | |
| run: bun run types | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # get part of the tag after the `v` | |
| - name: Extract tag version number | |
| id: get_version | |
| uses: battila7/get-version-action@v2 | |
| - name: setup bun | |
| uses: oven-sh/setup-bun@v1 | |
| - name: install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build JS | |
| run: bun run build | |
| - name: Create docs | |
| run: bun run docs | |
| - name: Deploy docs | |
| uses: JamesIves/[email protected] | |
| with: | |
| branch: gh-pages | |
| folder: docs | |
| # Substitute manifest/version/url/download links in the module.json, using jq | |
| - name: Replace placeholders in manifest with repo/version strings | |
| id: sub_manifest_link_version | |
| run: | | |
| jq '.version = "${{ steps.get_version.outputs.version-without-v }}" | | |
| .url = "https://github.com/${{github.repository}}" | | |
| .manifest = "https://github.com/${{github.repository}}/releases/latest/download/module.json" | | |
| .download = "https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip" | | |
| .flags.hotReload = false' dist/module.json > module.json | |
| mv module.json dist/module.json | |
| # Create a zip file with all files required by the module to add to the release | |
| - run: zip -q module.zip -r dist | |
| # Create a release for this specific version | |
| - name: Update Release with Files | |
| id: create_version_release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| allowUpdates: true # Set this to false if you want to prevent updating existing releases | |
| name: ${{ github.event.release.name }} | |
| draft: ${{ github.event.release.unpublished }} | |
| prerelease: ${{ github.event.release.prerelease }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: "./dist/module.json, ./module.zip" | |
| tag: ${{ github.event.release.tag_name }} | |
| body: ${{ github.event.release.body }} | |
| # Publish types to npm | |
| - name: Publish | |
| run: bun publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |