Skip to content

Commit cf20c6c

Browse files
authored
Switch release process to aspublish (#1519)
1 parent ec730cf commit cf20c6c

File tree

7 files changed

+88
-5807
lines changed

7 files changed

+88
-5807
lines changed

Diff for: .github/workflows/publish.yml

+34-15
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,47 @@ jobs:
1515
with:
1616
node-version: current
1717
- name: Install dependencies
18-
run: npm ci
19-
- name: Build distribution files
18+
run: | # npm>=7 is currently broken: https://github.com/npm/cli/issues/1973
19+
npm -g install npm@6
20+
npm -v
21+
npm ci
22+
- name: Build packages
2023
run: |
21-
npm run clean
22-
npm run build
23-
- name: Test distribution files
24-
run: npm test
25-
- name: Make semantic release
24+
VERSION=$(npx aspublish --version)
25+
if [[ "$VERSION" == "" ]]; then
26+
echo "Changes do not trigger a release"
27+
elif [[ "$VERSION" != "0."* ]]; then
28+
echo "Unexpected version: $VERSION"
29+
exit 1
30+
else
31+
echo "Building version: $VERSION"
32+
npm version "$VERSION" --no-git-tag-version
33+
npm run build
34+
npm test
35+
cd lib/loader
36+
npm version "$VERSION" --no-git-tag-version
37+
npm run build
38+
npm test
39+
cd ../rtrace
40+
npm version "$VERSION" --no-git-tag-version
41+
npm run build
42+
npm test
43+
cd ../..
44+
fi
45+
- name: Publish packages
2646
env:
2747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2848
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29-
# On success, semantic-release will update the version and publish,
30-
# triggering the postversion script that'll update the loader's version
31-
# as well. If nothing was published, the version will still be '0.0.0'.
3249
run: |
33-
git config --global user.name "GitHub Actions"
34-
git config --global user.email "[email protected]"
35-
node node_modules/semantic-release/bin/semantic-release.js --unstable
50+
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
51+
npx aspublish
52+
fi
3653
cd lib/loader
3754
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
38-
npm run build
39-
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
55+
npm publish --access public
56+
fi
57+
cd ../rtrace
58+
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
4059
npm publish --access public
4160
fi
4261
cd ../..

Diff for: lib/rtrace/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AssemblyScript Rtrace
22

3-
A tiny utility that records allocations, retains, releases and frees performed by the runtime and emits an error if something is off. Also checks for leaks.
3+
A tiny utility to sanitize the AssemblyScript runtime. Records allocations, retains, releases and frees performed by the runtime and emits an error if something is off. Also checks for leaks.
44

55
Instructions
66
------------

Diff for: lib/rtrace/package.json

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
{
22
"name": "@assemblyscript/rtrace",
3-
"version": "0.2.0",
3+
"description": "A tiny utility to sanitize the AssemblyScript runtime.",
4+
"keywords": [
5+
"assemblyscript",
6+
"rtrace",
7+
"webassembly",
8+
"wasm"
9+
],
10+
"version": "0.0.0",
11+
"author": "Daniel Wirtz <[email protected]>",
412
"license": "Apache-2.0",
13+
"homepage": "https://assemblyscript.org",
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/AssemblyScript/assemblyscript.git",
17+
"directory": "lib/rtrace"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/AssemblyScript/assemblyscript/issues"
21+
},
522
"type": "module",
623
"main": "index.js",
724
"types": "index.d.ts",
@@ -10,7 +27,8 @@
1027
"require": "./umd/index.js"
1128
},
1229
"scripts": {
13-
"build": "npx esm2umd rtrace index.js > umd/index.js"
30+
"build": "npx esm2umd rtrace index.js > umd/index.js",
31+
"test": "node tests"
1432
},
1533
"files": [
1634
"index.d.ts",

Diff for: lib/rtrace/tests/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO

0 commit comments

Comments
 (0)