Skip to content

Packages

Packages #298

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
permissions:
contents: read
id-token: write # Required for OIDC
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module: [ libixx, ixx, fixx ]
target: [ "25.11", "unstable" ]
steps:
- uses: actions/checkout@v5
- name: Find Version
if: startsWith(github.ref, 'refs/tags/')
id: meta
uses: docker/metadata-action@v5
with:
images: image
tags: type=semver,pattern={{version}}
- name: Set Cargo.toml version
if: startsWith(github.ref, 'refs/tags/')
run: |
sed -i'' "s/0\\.0\\.0-git/${{ steps.meta.outputs.version }}/" fixx/Cargo.toml
sed -i'' "s/0\\.0\\.0-git/${{ steps.meta.outputs.version }}/" ixx/Cargo.toml
sed -i'' "s/0\\.0\\.0-git/${{ steps.meta.outputs.version }}/" libixx/Cargo.toml
sed -i'' "s/0\\.0\\.0-git/${{ steps.meta.outputs.version }}/" Cargo.lock
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v33
- uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ runner.os }}-${{ matrix.module }}-${{ matrix.target }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.module }}-${{ matrix.target }}-
- name: build stable ${{ matrix.module }}
if: matrix.target != 'unstable'
run: |
nix build -L .#${{ matrix.module }} \
--override-input nixpkgs github:NixOS/nixpkgs/nixos-${{ matrix.target }}
- name: build unstable ${{ matrix.module }}
if: matrix.target == 'unstable'
run: nix build -L .#${{ matrix.module }}
- uses: actions/upload-artifact@v4
if: matrix.target != 'unstable'
with:
name: ${{ matrix.module }}
path: result
publish:
needs: [ build ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
name: fixx
path: result
- uses: actions/setup-node@v5
with:
registry-url: https://registry.npmjs.org
- run: npm publish --no-git-checks --access=public
working-directory: result/${{ matrix.module }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}