Skip to content

Publish preparations #941

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 1 commit into from
Nov 8, 2019
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: "Check preconditions"
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Publish
on:
schedule:
- cron: '0 5 * * *'
jobs:
publish:
name: "Publish packages"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: release
- name: Merge master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git fetch origin
git merge origin/master
- uses: actions/setup-node@v1
- name: Install dependencies
run: npm ci
- name: Build distribution files
run: |
npm run clean
npm run build
- name: Test distribution files
run: npm test
- name: Set up version
run: |
VERSION=$(node -e "console.log(require('./package.json').version)")
git add --force dist/*
if git rev-parse v$VERSION >/dev/null 2>&1; then
VERSION=$VERSION-nightly.$(date "+%Y%m%d")
if git rev-parse v$VERSION >/dev/null 2>&1; then
echo "Nightly $VERSION does already exist."
exit 1
fi
echo ::set-env name=CHANNEL::nightly
echo "Committing nightly ($VERSION) ..."
git commit -m "Nightly v$VERSION"
npm version $VERSION --no-git-tag-version --force
else
echo ::set-env name=CHANNEL::latest
echo "Committing release ($VERSION) ..."
git commit --allow-empty -m "Release v$VERSION"
fi
echo ::set-env name=VERSION::$VERSION
- name: Create tag and push distribution files
run: |
git tag v$VERSION
git push origin release
git push origin v$VERSION
# - name: Publish to npm
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# echo "npm publish --tag $CHANNEL"
# cd ./lib/loader
# npm version $VERSION --no-git-tag-version --force
# echo "npm publish --tag $CHANNEL"
# cd ../..
# - uses: actions/setup-node@v1
# with:
# registry-url: 'https://npm.pkg.github.com'
# scope: '@AssemblyScript'
# - name: Publish to gpr
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# echo "npm publish --tag $CHANNEL"
# cd ./lib/loader
# echo "npm publish --tag $CHANNEL"
# cd ../..
2 changes: 1 addition & 1 deletion lib/loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@assemblyscript/loader",
"version": "1.0.0",
"version": "0.0.0",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assemblyscript",
"version": "0.7.0",
"version": "0.8.0",
"author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>",
"license": "Apache-2.0",
"repository": {
Expand Down