Skip to content

Commit 40b8b71

Browse files
committed
fix: ci releases
1 parent 900f17a commit 40b8b71

File tree

2 files changed

+215
-196
lines changed

2 files changed

+215
-196
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,24 @@ jobs:
1010
check-lint:
1111
name: "Check / Lint"
1212
runs-on: ubuntu-latest
13-
container:
14-
image: ghcr.io/matrixai/github-runner
1513
steps:
1614
- uses: actions/checkout@v4
1715
- name: Run linting
1816
run: |
19-
nix develop --command bash -c $'
17+
npm install
2018
npm run lint
2119
npm run lint-shell
22-
'
2320
2421
check-test:
2522
name: "Check / Test"
2623
runs-on: ubuntu-latest
27-
container:
28-
image: ghcr.io/matrixai/github-runner
2924
steps:
3025
- uses: actions/checkout@v4
3126
- name: Run tests
3227
run: |
33-
nix develop .#ci --command bash -c $'
28+
npm install
3429
npm run prebuild --verbose
3530
npm test -- --ci --coverage
36-
'
3731
- uses: actions/upload-artifact@v4
3832
with:
3933
name: coverage-report
@@ -42,7 +36,6 @@ jobs:
4236
build-pull:
4337
name: "Build / Pull Request"
4438
runs-on: ubuntu-latest
45-
needs: [check-lint, check-test]
4639
if: github.ref == 'refs/heads/staging'
4740
steps:
4841
- uses: actions/checkout@v4
@@ -62,152 +55,13 @@ jobs:
6255
--body-file - \
6356
--repo "$GITHUB_REPOSITORY"
6457
65-
build-dist:
66-
name: "Build / Dist"
67-
runs-on: ubuntu-latest
68-
container:
69-
image: ghcr.io/matrixai/github-runner
70-
needs: [check-lint, check-test]
71-
if: github.ref == 'refs/heads/staging'
72-
steps:
73-
- uses: actions/checkout@v4
74-
- run: |
75-
nix develop .#ci --command bash -c $'
76-
npm run build --ignore-scripts --verbose
77-
'
78-
- uses: actions/upload-artifact@v4
79-
with:
80-
name: dist
81-
path: ./dist
82-
83-
build-platforms:
84-
name: "Build / Platforms"
85-
runs-on: ${{ matrix.os }}
86-
container:
87-
image: ${{ matrix.platform == 'linux' && 'ghcr.io/matrixai/github-runner' || null }}
88-
needs: build-dist
89-
if: github.ref == 'refs/heads/staging'
90-
strategy:
91-
fail-fast: false
92-
matrix:
93-
include:
94-
- platform: linux
95-
os: ubuntu-latest
96-
env:
97-
npm_config_arch: "x64"
98-
RUST_BACKTRACE: "1"
99-
script: |
100-
nix develop .#ci --command bash -c $'
101-
npm run prebuild --verbose -- --production
102-
npm test -- --ci --coverage
103-
npm run bench
104-
'
105-
- platform: windows
106-
os: windows-latest
107-
env:
108-
npm_config_arch: "x64"
109-
RUST_BACKTRACE: "1"
110-
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\bin"
111-
script: |
112-
mkdir -Force "$CI_PROJECT_DIR/tmp"
113-
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
114-
./scripts/choco-install.ps1
115-
refreshenv
116-
npm install --ignore-scripts
117-
$env:Path = "$(npm root)\.bin;" + $env:Path
118-
npm run prebuild --verbose -- --production
119-
npm test -- --ci --coverage
120-
npm run bench
121-
- platform: macos
122-
os: macos-latest
123-
env:
124-
RUST_BACKTRACE: "1"
125-
script: |
126-
eval "$(brew shellenv)"
127-
./scripts/brew-install.sh
128-
hash -r
129-
npm install --ignore-scripts
130-
export PATH="$(npm root)/.bin:$PATH"
131-
export PATH="$HOME/.cargo/bin:$PATH"
132-
npm run prebuild --verbose -- --arch x64 --production
133-
npm run prebuild --verbose -- --arch arm64 --production
134-
lipo -create -output prebuild/quic-darwin-x64+arm64.node prebuild/quic-darwin-arm64.node prebuild/quic-darwin-x64.node
135-
rm -rf node_modules/@matrixai/quic-*
136-
npm test -- --ci --coverage
137-
npm run bench
138-
steps:
139-
- uses: actions/checkout@v4
140-
- uses: actions/setup-node@v4
141-
with:
142-
node-version: '20'
143-
- uses: actions/download-artifact@v4
144-
with:
145-
name: dist
146-
path: ./dist
147-
- name: Build
148-
env: ${{ matrix.env }}
149-
run: ${{ matrix.script }}
150-
- uses: actions/upload-artifact@v4
151-
with:
152-
name: builds-${{ matrix.platform }}
153-
path: ./builds
154-
155-
build-prerelease:
156-
name: "Build / Pre-release"
157-
runs-on: ubuntu-latest
158-
container:
159-
image: ghcr.io/matrixai/github-runner
160-
concurrency:
161-
group: build-prerelease
162-
cancel-in-progress: false
163-
needs: [check-lint, check-test]
164-
if: >
165-
github.ref == 'refs/heads/staging' &&
166-
startsWith(github.ref, 'refs/tags/v') &&
167-
contains(github.ref, '-')
168-
steps:
169-
- uses: actions/checkout@v4
170-
- uses: actions/download-artifact@v4
171-
with:
172-
pattern: builds*
173-
path: builds
174-
merge-multiple: true
175-
- name: Run pre-release
176-
env:
177-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
178-
run: |
179-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
180-
echo 'Publishing library prerelease'
181-
nix develop .#ci --command bash -c $'
182-
npm publish --tag prerelease --access public
183-
'
184-
for d in prebuild/*; do
185-
tar \
186-
--create \
187-
--verbose \
188-
--file="prebuild/$(basename $d).tar" \
189-
--directory=prebuild \
190-
"$(basename $d)"
191-
done
192-
nix develop .#ci --command bash -c $'
193-
gh release \
194-
create "$GITHUB_REF_NAME" \
195-
prebuild/*.tar \
196-
--title "$GITHUB_REF_NAME-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
197-
--notes "" \
198-
--prerelease \
199-
--target staging \
200-
--repo "$GITHUB_REPOSITORY"
201-
'
202-
rm -f ./.npmrc
203-
20458
integration-merge:
20559
name: "Integration / Merge"
20660
runs-on: ubuntu-latest
20761
concurrency:
20862
group: integration-merge
20963
cancel-in-progress: true
210-
needs: [build-pull, build-platforms]
64+
needs: build-pull
21165
if: github.ref == 'refs/heads/staging'
21266
steps:
21367
- uses: actions/checkout@v4
@@ -230,50 +84,3 @@ jobs:
23084
git merge --ff-only "$GITHUB_SHA"
23185
git push origin master
23286
233-
release-distribution:
234-
name: "Release / Distribution"
235-
runs-on: ubuntu-latest
236-
container:
237-
image: ghcr.io/matrixai/github-runner
238-
concurrency:
239-
group: release-distribution
240-
cancel-in-progress: false
241-
needs: integration-merge
242-
if: >
243-
github.ref == 'refs/heads/staging' &&
244-
startsWith(github.ref, 'refs/tags/v') &&
245-
!contains(github.ref, '-')
246-
steps:
247-
- uses: actions/checkout@v4
248-
- uses: actions/download-artifact@v4
249-
with:
250-
pattern: builds*
251-
path: builds
252-
merge-multiple: true
253-
- name: Run release
254-
env:
255-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
256-
run: |
257-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
258-
echo 'Publishing library'
259-
nix develop .#ci --command bash -c $'
260-
npm publish --access public
261-
'
262-
for d in prebuild/*; do
263-
tar \
264-
--create \
265-
--verbose \
266-
--file="prebuild/$(basename $d).tar" \
267-
--directory=prebuild \
268-
"$(basename $d)"
269-
done
270-
nix develop .#ci --command bash -c $'
271-
gh release \
272-
create "$GITHUB_REF_NAME" \
273-
prebuild/*.tar \
274-
--title "$GITHUB_REF_NAME-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
275-
--notes "" \
276-
--target master \
277-
--repo "$GITHUB_REPOSITORY"
278-
'
279-
rm -f ./.npmrc

0 commit comments

Comments
 (0)