Skip to content

Commit a65b0f7

Browse files
chore: modernize to latest rainix (flake + CI)
- flake: point at github:rainlanguage/rainix; bump lock; drop the removed rainix-rs-prelude/test/artifacts devShell refs (flake no longer evaluated against latest rainix); base the shell on rainix.devShells.rust-node-shell (rust + node + wasm-bindgen) while keeping the dotrain binary + js-binding tasks - CI: replace bespoke rainix.yaml (dead magic-nix-cache, removed tasks) with reusable rainix-rs-static + rainix-rs-test + a js-bindings job; drop wasm-test (the cli isn't wasm-targeted; js bindings are built via npm/wasm-pack) - manual-release: swap dead magic-nix-cache for cache-nix-action, drop the removed rainix-rs-prelude, rainix-rs-test -> cargo test - apply latest rainix formatter hooks (taplo/denofmt/rustfmt config) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 34ab3e7 commit a65b0f7

9 files changed

Lines changed: 358 additions & 281 deletions

File tree

.github/workflows/manual-release.yaml

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ on:
77
required: true
88
type: choice
99
options:
10-
- alpha # Increase the alpha pre-version (x.y.z-alpha.M)
11-
- beta # Increase the beta pre-version (x.y.z-beta.M)
12-
- patch # Increase the patch version (x.y.z)
13-
- minor # Increase the minor version (x.y.0)
14-
- major # Increase the major version (x.0.0)
10+
- alpha # Increase the alpha pre-version (x.y.z-alpha.M)
11+
- beta # Increase the beta pre-version (x.y.z-beta.M)
12+
- patch # Increase the patch version (x.y.z)
13+
- minor # Increase the minor version (x.y.0)
14+
- major # Increase the major version (x.0.0)
1515
- release # Remove the pre-version, ie remove alpha/beta/rc (x.y.z)
16-
- rc # Increase the rc pre-version (x.y.z-rc.M)
17-
16+
- rc # Increase the rc pre-version (x.y.z-rc.M)
1817
jobs:
1918
release:
2019
runs-on: ubuntu-latest
@@ -26,71 +25,62 @@ jobs:
2625
fetch-depth: 0
2726
submodules: recursive
2827
ssh-key: ${{ secrets.PUBLISHER_SSH_KEY }}
29-
30-
- uses: DeterminateSystems/nix-installer-action@v4
31-
- uses: DeterminateSystems/magic-nix-cache-action@v2
32-
28+
- uses: nixbuild/nix-quick-install-action@v30
29+
with:
30+
nix_conf: |
31+
keep-env-derivations = true
32+
keep-outputs = true
33+
- name: Restore and save Nix store
34+
uses: nix-community/cache-nix-action@v6
35+
with:
36+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
37+
restore-prefixes-first-match: nix-${{ runner.os }}-
38+
gc-max-store-size-linux: 1G
3339
- name: Install NodeJS v22
3440
uses: actions/setup-node@v4
3541
with:
3642
node-version: 22
3743
cache: 'npm'
38-
39-
- run: nix develop -c rainix-rs-prelude
40-
4144
- name: Run rainix-rs-test
42-
run: nix develop -c rainix-rs-test
43-
45+
run: nix develop -c cargo test
4446
- name: Build JS Bindings
45-
run: nix develop -c build-js-bindings
46-
47+
run: nix develop -c build-js-bindings
4748
- name: Run JS Tests
48-
run: nix develop -c test-js-bindings
49-
49+
run: nix develop -c test-js-bindings
5050
- name: Git Config
5151
run: |
5252
git config --global user.email "${{ secrets.CI_GIT_EMAIL }}"
5353
git config --global user.name "${{ secrets.CI_GIT_USER }}"
54-
5554
- name: Publish to crates.io
5655
run: nix develop -c cargo release --no-confirm --execute --no-tag --workspace ${{ inputs.version-level }}
5756
env:
5857
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
59-
6058
# set npm version to rust crate version
6159
- name: Set Version
6260
run: echo "NEW_VERSION=$(nix develop -c npm version $(node ./scripts/version.js) --no-git-tag-version)" >> $GITHUB_ENV
63-
6461
# Commit changes and tag
6562
- name: Commit And Tag
6663
run: |
6764
git add "package.json"
6865
git add "package-lock.json"
6966
git commit -m "Release ${{ env.NEW_VERSION }}"
7067
git tag ${{ env.NEW_VERSION }}
71-
7268
# Push the commit to remote
7369
- name: Push Changes To Remote
74-
run: |
75-
git push origin
76-
git push -u origin ${{ env.NEW_VERSION }}
70+
run: "git push origin \ngit push -u origin ${{ env.NEW_VERSION }}\n"
7771
env:
7872
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
8073
# Create npm package tarball to put in release files
8174
- name: Create NPM Package Tarball
8275
run: echo "NPM_PACKAGE=$(nix develop -c npm pack --silent)" >> $GITHUB_ENV
83-
8476
- name: Rename NPM Package Tarball
8577
run: mv ${{ env.NPM_PACKAGE }} dotrain_npm_package_${{ env.NEW_VERSION }}.tgz
86-
8778
# publish to npm
8879
- name: Publish To NPM
8980
uses: JS-DevTools/npm-publish@v1
9081
with:
9182
token: ${{ secrets.NPM_TOKEN }}
9283
access: public
93-
9484
# Create gitHub release with npm tarball
9585
- name: Create GitHub Release
9686
id: gh_release
@@ -101,16 +91,14 @@ jobs:
10191
files: dotrain_npm_package_${{ env.NEW_VERSION }}.tgz
10292
env:
10393
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104-
105-
10694
release_bin:
10795
name: Release dotrain cli ${{ matrix.platform }}_${{ matrix.arch }} bin
10896
needs: release
10997
runs-on: ${{ matrix.runner }}
11098
strategy:
11199
fail-fast: false
112100
matrix:
113-
include:
101+
include:
114102
- runner: ubuntu-22.04
115103
target: x86_64-unknown-linux-gnu
116104
platform: linux
@@ -127,30 +115,32 @@ jobs:
127115
target: aarch64-apple-darwin
128116
platform: darwin
129117
arch: arm64
130-
131118
steps:
132119
- uses: actions/checkout@v4
133120
with:
134121
fetch-depth: 0
135122
submodules: recursive
136123
ssh-key: ${{ secrets.PUBLISHER_SSH_KEY }}
137-
138-
- uses: DeterminateSystems/nix-installer-action@v4
139-
- uses: DeterminateSystems/magic-nix-cache-action@v2
140-
124+
- uses: nixbuild/nix-quick-install-action@v30
125+
with:
126+
nix_conf: |
127+
keep-env-derivations = true
128+
keep-outputs = true
129+
- name: Restore and save Nix store
130+
uses: nix-community/cache-nix-action@v6
131+
with:
132+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
133+
restore-prefixes-first-match: nix-${{ runner.os }}-
134+
gc-max-store-size-linux: 1G
141135
- name: Git Config
142136
run: |
143137
git config --global user.email "${{ secrets.CI_GIT_EMAIL }}"
144138
git config --global user.name "${{ secrets.CI_GIT_USER }}"
145-
146139
- name: Pull Release Commit
147140
run: git pull origin
148-
149141
- name: Build Bin
150142
run: nix develop -c cargo build -r --features cli --bin dotrain --target "${{ matrix.target }}"
151-
152143
- run: cp ./target/${{ matrix.target }}/release/dotrain ./dotrain_cli_${{ needs.release.outputs.version }}_${{ matrix.platform }}_${{ matrix.arch }}
153-
154144
- name: Add Bin To Release
155145
uses: softprops/action-gh-release@v2
156146
with:

.github/workflows/pr-assessment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
pull_request:
44
types:
55
- closed
6-
76
jobs:
87
assess-pr-size-on-merge:
98
uses: rainlanguage/github-chore/.github/workflows/pr-assessment.yml@main

.github/workflows/rainix.yaml

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,25 @@
1-
name: Rainix CI
1+
name: rainix-rs
22
on: [push]
3-
43
jobs:
5-
rainix:
6-
strategy:
7-
matrix:
8-
os: [ubuntu-latest, macos-latest]
9-
task: [rainix-rs-test, rainix-rs-artifacts]
10-
include:
11-
# We don't need to do rust static analysis on multiple platforms
12-
- os: ubuntu-latest
13-
task: rainix-rs-static
14-
fail-fast: false
15-
runs-on: ${{ matrix.os }}
16-
4+
static:
5+
uses: rainlanguage/rainix/.github/workflows/rainix-rs-static.yaml@main
6+
test:
7+
uses: rainlanguage/rainix/.github/workflows/rainix-rs-test.yaml@main
8+
js-bindings:
9+
runs-on: ubuntu-latest
1710
steps:
1811
- uses: actions/checkout@v4
12+
- uses: nixbuild/nix-quick-install-action@v30
1913
with:
20-
submodules: recursive
21-
fetch-depth: 0
22-
23-
- uses: DeterminateSystems/nix-installer-action@v4
24-
- uses: DeterminateSystems/magic-nix-cache-action@v2
25-
26-
- run: nix develop -c rainix-rs-prelude
27-
28-
- name: Run ${{ matrix.task }}
29-
run: nix develop -c ${{ matrix.task }}
30-
31-
- name: Build JS Bindings
32-
run: nix develop -c build-js-bindings
33-
34-
- name: Run JS Tests
35-
run: nix develop -c test-js-bindings
36-
37-
- name: Test JS Doc Generation
38-
run: nix develop -c js-bindings-docs
14+
nix_conf: |
15+
keep-env-derivations = true
16+
keep-outputs = true
17+
- name: Restore and save Nix store
18+
uses: nix-community/cache-nix-action@v6
19+
with:
20+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
21+
restore-prefixes-first-match: nix-${{ runner.os }}-
22+
gc-max-store-size-linux: 1G
23+
- run: nix develop -c build-js-bindings
24+
- run: nix develop -c test-js-bindings
25+
- run: nix develop -c js-bindings-docs

.rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ reorder_imports = false
33
reorder_modules = false
44
# group_imports = "StdExternalCrate"
55
# imports_layout = "HorizontalVertical"
6-
# unstable_features = true
6+
# unstable_features = true

0 commit comments

Comments
 (0)