Skip to content

Closures Continued #1308

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

Closed
wants to merge 2 commits into from
Closed
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
67 changes: 50 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
name: Publish
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- master
jobs:
release:
name: Packages
if: github.repository == 'AssemblyScript/assemblyscript'
publish:
name: "Packages"
if: github.repository == 'DuncanUszkay1/assemblyscript'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: master
ref: release
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- 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
- name: Install dependencies
run: npm ci
- name: Build distribution files
Expand All @@ -22,18 +32,41 @@ jobs:
npm run build
- name: Test distribution files
run: npm test
- name: Make semantic release
- 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
cd lib/loader
npm version $VERSION --no-git-tag-version --force
cd ../..
- 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:
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'.
NPM_REGISTRY: "registry.npmjs.org"
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
node node_modules/semantic-release/bin/semantic-release.js --unstable
npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}"
npm publish --tag $CHANNEL
cd lib/loader
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
npm publish --access public
fi
npm publish --tag $CHANNEL --access public
cd ../..
9 changes: 2 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ jobs:
exit 1
fi
npm test
- name: Test browser build
run: node tests/browser-asc
test-windows:
name: "Compiler (Windows, node current)"
runs-on: windows-latest
Expand All @@ -89,8 +87,6 @@ jobs:
run: npm run build
- name: Test distribution
run: npm test
- name: Test browser build
run: node tests/browser-asc
test-macos:
name: "Compiler (MacOS, node current)"
runs-on: macos-latest
Expand All @@ -110,8 +106,6 @@ jobs:
run: npm run build
- name: Test distribution
run: npm test
- name: Test browser build
run: node tests/browser-asc
test-features:
name: "Features"
runs-on: ubuntu-latest
Expand All @@ -121,7 +115,8 @@ jobs:
- uses: dcodeIO/setup-node-nvm@master
with:
node-mirror: https://nodejs.org/download/v8-canary/
node-version: "15.0.0-v8-canary202007077c53168ead"
# FIXME: newer node-v8 builds are currently broken
node-version: "14.0.0-v8-canary201911242015a12d82"
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
Expand Down