Skip to content

Switch release process to aspublish #1519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,47 @@ jobs:
with:
node-version: current
- name: Install dependencies
run: npm ci
- name: Build distribution files
run: | # npm>=7 is currently broken: https://github.com/npm/cli/issues/1973
npm -g install npm@6
npm -v
npm ci
- name: Build packages
run: |
npm run clean
npm run build
- name: Test distribution files
run: npm test
- name: Make semantic release
VERSION=$(npx aspublish --version)
if [[ "$VERSION" == "" ]]; then
echo "Changes do not trigger a release"
elif [[ "$VERSION" != "0."* ]]; then
echo "Unexpected version: $VERSION"
exit 1
else
echo "Building version: $VERSION"
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd lib/loader
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd ../rtrace
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd ../..
fi
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# On success, semantic-release will update the version and publish,
# triggering the postversion script that'll update the loader's version
# as well. If nothing was published, the version will still be '0.0.0'.
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
node node_modules/semantic-release/bin/semantic-release.js --unstable
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npx aspublish
fi
cd lib/loader
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm run build
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
npm publish --access public
fi
cd ../rtrace
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm publish --access public
fi
cd ../..
2 changes: 1 addition & 1 deletion lib/rtrace/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AssemblyScript Rtrace

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.
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.

Instructions
------------
Expand Down
22 changes: 20 additions & 2 deletions lib/rtrace/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
{
"name": "@assemblyscript/rtrace",
"version": "0.2.0",
"description": "A tiny utility to sanitize the AssemblyScript runtime.",
"keywords": [
"assemblyscript",
"rtrace",
"webassembly",
"wasm"
],
"version": "0.0.0",
"author": "Daniel Wirtz <[email protected]>",
"license": "Apache-2.0",
"homepage": "https://assemblyscript.org",
"repository": {
"type": "git",
"url": "https://github.com/AssemblyScript/assemblyscript.git",
"directory": "lib/rtrace"
},
"bugs": {
"url": "https://github.com/AssemblyScript/assemblyscript/issues"
},
"type": "module",
"main": "index.js",
"types": "index.d.ts",
Expand All @@ -10,7 +27,8 @@
"require": "./umd/index.js"
},
"scripts": {
"build": "npx esm2umd rtrace index.js > umd/index.js"
"build": "npx esm2umd rtrace index.js > umd/index.js",
"test": "node tests"
},
"files": [
"index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions lib/rtrace/tests/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO
Loading