-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (59 loc) · 1.84 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
module: [ libixx, ixx, fixx ]
steps:
- uses: actions/checkout@v4
- 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
- uses: cachix/install-nix-action@v30
- uses: DeterminateSystems/magic-nix-cache-action@v8
with:
diagnostic-endpoint: false
use-flakehub: false
- name: build ${{ matrix.module }}
run: nix build -L .#${{ matrix.module }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.module }}
path: result
publish:
needs: [ build ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: fixx
path: result
- uses: actions/setup-node@v4
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 }}