Skip to content

Commit 6db9b1e

Browse files
authored
Publish preparations (#941)
1 parent ce0457e commit 6db9b1e

File tree

4 files changed

+83
-3
lines changed

4 files changed

+83
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: CI
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
37
jobs:
48
check:
59
name: "Check preconditions"

.github/workflows/publish.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *'
5+
jobs:
6+
publish:
7+
name: "Publish packages"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
with:
12+
ref: release
13+
- name: Merge master
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
run: |
17+
git config user.name "GitHub Actions"
18+
git config user.email "[email protected]"
19+
git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
20+
git fetch origin
21+
git merge origin/master
22+
- uses: actions/setup-node@v1
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Build distribution files
26+
run: |
27+
npm run clean
28+
npm run build
29+
- name: Test distribution files
30+
run: npm test
31+
- name: Set up version
32+
run: |
33+
VERSION=$(node -e "console.log(require('./package.json').version)")
34+
git add --force dist/*
35+
if git rev-parse v$VERSION >/dev/null 2>&1; then
36+
VERSION=$VERSION-nightly.$(date "+%Y%m%d")
37+
if git rev-parse v$VERSION >/dev/null 2>&1; then
38+
echo "Nightly $VERSION does already exist."
39+
exit 1
40+
fi
41+
echo ::set-env name=CHANNEL::nightly
42+
echo "Committing nightly ($VERSION) ..."
43+
git commit -m "Nightly v$VERSION"
44+
npm version $VERSION --no-git-tag-version --force
45+
else
46+
echo ::set-env name=CHANNEL::latest
47+
echo "Committing release ($VERSION) ..."
48+
git commit --allow-empty -m "Release v$VERSION"
49+
fi
50+
echo ::set-env name=VERSION::$VERSION
51+
- name: Create tag and push distribution files
52+
run: |
53+
git tag v$VERSION
54+
git push origin release
55+
git push origin v$VERSION
56+
# - name: Publish to npm
57+
# env:
58+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
59+
# run: |
60+
# echo "npm publish --tag $CHANNEL"
61+
# cd ./lib/loader
62+
# npm version $VERSION --no-git-tag-version --force
63+
# echo "npm publish --tag $CHANNEL"
64+
# cd ../..
65+
# - uses: actions/setup-node@v1
66+
# with:
67+
# registry-url: 'https://npm.pkg.github.com'
68+
# scope: '@AssemblyScript'
69+
# - name: Publish to gpr
70+
# env:
71+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
# run: |
73+
# echo "npm publish --tag $CHANNEL"
74+
# cd ./lib/loader
75+
# echo "npm publish --tag $CHANNEL"
76+
# cd ../..

lib/loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@assemblyscript/loader",
3-
"version": "1.0.0",
3+
"version": "0.0.0",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"scripts": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "assemblyscript",
3-
"version": "0.7.0",
3+
"version": "0.8.0",
44
"author": "Daniel Wirtz <[email protected]>",
55
"license": "Apache-2.0",
66
"repository": {

0 commit comments

Comments
 (0)