Skip to content

Commit

Permalink
Add github release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPrimate committed Oct 25, 2020
1 parent 4b5df68 commit 987b9b4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/get-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var fs = require('fs');
console.log(JSON.parse(fs.readFileSync('module.json', 'utf8')).version);
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: vtta-tokenizer CI

on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Version # Run the script that returns the version from `module.json`
shell: bash
id: get-version
run: echo "::set-output name=version::$(node ./.github/workflows/get-version.js)"
- run: zip -r ./vtta-tokenizer.zip module.json src css img lang LICENSE.md # Add folders/files here
- name: Create Release # Create an additional release for this version
id: create_versioned_release
uses: ncipollo/release-action@v1
with:
allowUpdates: false # set to false if you do not want to allow updates on existing releases
name: Release ${{ steps.get-version.outputs.version }} # Use the version in the name
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json,./vtta-tokenizer.zip' # don't forget to rename module zip thing
tag: ${{ steps.get-version.outputs.version }} # Use the version as the tag
- name: Create Release
id: create_latest_release
uses: ncipollo/release-action@v1
if: endsWith(github.ref, 'master') # Only update the latest release when pushing to the master branch
with:
allowUpdates: true
name: Latest
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json,./vtta-tokenizer.zip' # don't forget to rename module zip thing
tag: latest

0 comments on commit 987b9b4

Please sign in to comment.