Skip to content

Commit

Permalink
First version of github actions (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
fboucquez authored Jan 12, 2022
1 parent 6d02077 commit b3ff18d
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: build
on: [push]
jobs:
build:
name: Build, Test, Coverage
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm pack
- run: npm test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run lint
doc:
name: Github Pages Deploy
runs-on: ubuntu-latest
if: contains(github.base_ref, 'dev')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run doc
- name: Deploy Docs
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ts-docs
alpha:
needs: build
name: Alpha NPM Deploy
runs-on: ubuntu-latest
if: contains(github.base_ref, 'dev')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm pack
- id: version
run: echo "version=$(npm run version --silent)" >> $GITHUB_ENV
- id: newVersion
run: echo "newVersion=${{ env.version }}-alpha-${GITHUB_SHA::7}" >> $GITHUB_ENV
- run: echo "Deploying version ${{ env.newVersion }}"
- run: npm version "${{ env.newVersion }}" --commit-hooks false --git-tag-version false
- run: npm publish --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# steps:
# - uses: actions/checkout@v2
# - run: sudo rm /usr/local/bin/docker-compose
# - run: curl -L https://github.com/docker/compose/releases/download/${env.DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
# - run: chmod +x docker-compose
# - sudo mv docker-compose /usr/local/bin
# - name: Build symbol.yml
# run: python3 -m catparser --schema symbol/all.cats --include symbol --output dist/symbol.yml
# - name: Build nem.yml
# run: python3 -m catparser --schema nem/all.cats --include nem --output dist/nem.yml
# - run: ls -la dist
# - uses: 'marvinpinto/action-automatic-releases@latest'
# name: Publish Pre Release
# if: github.ref == 'refs/heads/main'
# with:
# repo_token: '${{ secrets.GITHUB_TOKEN }}'
# automatic_release_tag: 'alpha'
# prerelease: true
# title: 'Alpha Build'
# files: |
# dist/symbol.yml
# dist/nem.yml
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
workflow_dispatch:
inputs:
name:
description: 'Person to greet'
required: true
default: 'Mona the Octocat'
home:
description: 'location'
required: false
default: 'The Octoverse'
jobs:
release:
runs-on: ubuntu-latest
steps:
- run: echo "Hello ${{ github.event.inputs.name }} - in ${{ github.event.inputs.home }}!"
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm pack
- run: echo "Release ${{ github.ref }}"
- id: version
run: echo "version=$(npm run version --silent)" >> $GITHUB_ENV
- run: echo "Deploying version ${{ env.version }}"
# - run: npm publish --tag alpha
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.

0 comments on commit b3ff18d

Please sign in to comment.