Skip to content

Commit 085aa7f

Browse files
authored
chore: Set up semantic release (#1332)
1 parent 888b768 commit 085aa7f

File tree

5 files changed

+6097
-240
lines changed

5 files changed

+6097
-240
lines changed

Diff for: .github/workflows/publish.yml

+10-61
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
name: Publish
22
on:
3+
push:
4+
branches:
5+
- master
36
schedule:
47
- cron: '0 0 * * *'
58
jobs:
6-
publish:
7-
name: "Packages"
9+
release:
10+
name: Packages
811
if: github.repository == 'AssemblyScript/assemblyscript'
912
runs-on: ubuntu-latest
1013
steps:
1114
- uses: actions/checkout@v1
1215
with:
13-
ref: release
16+
ref: master
1417
- uses: dcodeIO/setup-node-nvm@master
1518
with:
1619
node-version: current
17-
- name: Merge master
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
run: |
21-
git config user.name "GitHub Actions"
22-
git config user.email "[email protected]"
23-
git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
24-
git fetch origin
25-
git merge origin/master
2620
- name: Install dependencies
2721
run: npm ci
2822
- name: Build distribution files
@@ -31,53 +25,8 @@ jobs:
3125
npm run build
3226
- name: Test distribution files
3327
run: npm test
34-
- name: Set up version
35-
run: |
36-
VERSION=$(node -e "console.log(require('./package.json').version)")
37-
git add --force dist/*
38-
if git rev-parse v$VERSION >/dev/null 2>&1; then
39-
VERSION=$VERSION-nightly.$(date "+%Y%m%d")
40-
if git rev-parse v$VERSION >/dev/null 2>&1; then
41-
echo "Nightly $VERSION does already exist."
42-
exit 1
43-
fi
44-
echo ::set-env name=CHANNEL::nightly
45-
echo "Committing nightly ($VERSION) ..."
46-
git commit -m "Nightly v$VERSION"
47-
npm version $VERSION --no-git-tag-version --force
48-
else
49-
echo ::set-env name=CHANNEL::latest
50-
echo "Committing release ($VERSION) ..."
51-
git commit --allow-empty -m "Release v$VERSION"
52-
fi
53-
echo ::set-env name=VERSION::$VERSION
54-
cd lib/loader
55-
npm version $VERSION --no-git-tag-version --force
56-
cd ../..
57-
- name: Create tag and push distribution files
58-
run: |
59-
git tag v$VERSION
60-
git push origin release
61-
git push origin v$VERSION
62-
- name: Publish to npm
28+
- name: Make semantic release
6329
env:
64-
NPM_REGISTRY: "registry.npmjs.org"
65-
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
66-
run: |
67-
npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}"
68-
npm publish --tag $CHANNEL
69-
cd lib/loader
70-
npm publish --tag $CHANNEL --access public
71-
cd ../..
72-
# - name: Publish to gpr
73-
# env:
74-
# NPM_REGISTRY: "npm.pkg.github.com"
75-
# NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
# run: |
77-
# npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}"
78-
# sed -i 's/"assemblyscript"/"@assemblyscript\/assemblyscript"/' package.json
79-
# sed -i 's/"assemblyscript"/"@assemblyscript\/assemblyscript"/' package-lock.json
80-
# npm publish --registry=https://${NPM_REGISTRY}
81-
# cd lib/loader
82-
# npm publish --registry=https://${NPM_REGISTRY}
83-
# cd ../..
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
run: node node_modules/semantic-release/bin/semantic-release.js --unstable --dry-run

Diff for: README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
<a href="https://assemblyscript.org" target="_blank" rel="noopener"><img width="100" src="https://avatars1.githubusercontent.com/u/28916798?s=200&v=4" alt="AssemblyScript logo"></a>
33
</p>
44

5-
<h1 align="center">AssemblyScript Compiler</h1>
6-
75
<p align="center">
86
<a href="https://github.com/AssemblyScript/assemblyscript/actions"><img src="https://github.com/AssemblyScript/assemblyscript/workflows/Test/badge.svg?branch=master&event=push" alt="Actions Status" /></a>
97
<a href="https://www.npmjs.com/package/assemblyscript"><img src="https://img.shields.io/npm/v/assemblyscript.svg?color=0074C1" alt="npm package" /></a>
108
<a href="https://www.npmjs.com/package/assemblyscript"><img src="https://img.shields.io/npm/v/assemblyscript/nightly.svg?color=0074C1" alt="npm package (nightly)" /></a>
119
</p>
1210

13-
<p align="justify">AssemblyScript compiles a strict variant of <a href="http://www.typescriptlang.org">TypeScript</a> (basically JavaScript with types) to <a href="http://webassembly.org">WebAssembly</a> using <a href="https://github.com/WebAssembly/binaryen">Binaryen</a>. It generates lean and mean WebAssembly modules while being just an <code>npm install</code> away.</p>
11+
<p align="justify"><strong>AssemblyScript</strong> compiles a strict variant of <a href="http://www.typescriptlang.org">TypeScript</a> (basically JavaScript with types) to <a href="http://webassembly.org">WebAssembly</a> using <a href="https://github.com/WebAssembly/binaryen">Binaryen</a>. It generates lean and mean WebAssembly modules while being just an <code>npm install</code> away.</p>
1412

1513
<p align="center">
1614
<a href="https://assemblyscript.org">About</a> ·

0 commit comments

Comments
 (0)