Skip to content

chore: Set up semantic release #1332

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
Jun 13, 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
71 changes: 10 additions & 61 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
name: Publish
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'
jobs:
publish:
name: "Packages"
release:
name: Packages
if: github.repository == 'AssemblyScript/assemblyscript'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: release
ref: master
- 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 @@ -31,53 +25,8 @@ jobs:
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
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
- name: Make semantic release
env:
NPM_REGISTRY: "registry.npmjs.org"
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}"
npm publish --tag $CHANNEL
cd lib/loader
npm publish --tag $CHANNEL --access public
cd ../..
# - name: Publish to gpr
# env:
# NPM_REGISTRY: "npm.pkg.github.com"
# NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}"
# sed -i 's/"assemblyscript"/"@assemblyscript\/assemblyscript"/' package.json
# sed -i 's/"assemblyscript"/"@assemblyscript\/assemblyscript"/' package-lock.json
# npm publish --registry=https://${NPM_REGISTRY}
# cd lib/loader
# npm publish --registry=https://${NPM_REGISTRY}
# cd ../..
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: node node_modules/semantic-release/bin/semantic-release.js --unstable --dry-run
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
<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>
</p>

<h1 align="center">AssemblyScript Compiler</h1>

<p align="center">
<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>
<a href="https://www.npmjs.com/package/assemblyscript"><img src="https://img.shields.io/npm/v/assemblyscript.svg?color=0074C1" alt="npm package" /></a>
<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>
</p>

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

<p align="center">
<a href="https://assemblyscript.org">About</a> ·
Expand Down
Loading