Skip to content
Open
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
43 changes: 43 additions & 0 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
release:
name: Packages
if: github.repository == 'MaxGraey/as-bignum'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: master
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: |
npm -v
npm install
- name: Build packages
run: |
VERSION=$(npx aspublish --version)
if [[ "$VERSION" == "" ]]; then
echo "Changes do not trigger a release"
elif [[ "$VERSION" != "0."* ]]; then
echo "Unexpected version: $VERSION"
exit 1
else
echo "Building version: $VERSION"
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
fi
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npx aspublish
fi