Skip to content

feat: create a separate devshell for CI purposes #39

feat: create a separate devshell for CI purposes

feat: create a separate devshell for CI purposes #39

Workflow file for this run

name: "Build and publish"
on:
pull_request:
types:
- closed
branches:
- main
jobs:
generate-documentation:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-")

Check failure on line 11 in .github/workflows/build.yaml

View workflow run for this annotation

GitHub Actions / Build and publish

Invalid workflow file

The workflow is not valid. .github/workflows/build.yaml (Line: 11, Col: 9): Unexpected symbol: '"bump-"'. Located at position 84 within expression: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-") .github/workflows/build.yaml (Line: 42, Col: 9): Unexpected symbol: '"bump-"'. Located at position 84 within expression: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-")

Check failure on line 11 in .github/workflows/build.yaml

View workflow run for this annotation

GitHub Actions / Build and publish

Invalid workflow file

The workflow is not valid. .github/workflows/build.yaml (Line: 11, Col: 9): Unexpected symbol: '"bump-"'. Located at position 84 within expression: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-") .github/workflows/build.yaml (Line: 42, Col: 9): Unexpected symbol: '"bump-"'. Located at position 84 within expression: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-")
name: Generate and publish documentation
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
packages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v28
- name: Activate Nix cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock', '**/Cargo.lock', '**/yarn.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size: 2684354560 # 2.5 GB
- name: Build documentation
run: nix build .#docs
- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./result/share/doc
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
build-and-publish:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-")
name: Build and publish ${{ matrix.package }}
runs-on: ubuntu-latest
strategy:
matrix:
package: [cjs, esm]
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v28
- name: Activate Nix cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock', '**/Cargo.lock', '**/yarn.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size: 2684354560 # 2.5 GB
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: latest
registry-url: https://registry.npmjs.org
- name: Build ${{ matrix.package }} package
run: nix build .#${{ matrix.package }}
- name: Publish ${{ matrix.package }} package
run: npm publish --access public
working-directory: ./result
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}