Skip to content
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

Add publish action for release branches #11

Merged
merged 10 commits into from
Mar 27, 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
41 changes: 41 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Publish Release

on:
push:
tags:
- 'releases/*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 13.x
- run: npm install
- run: npm test
env:
CI: true
- run: npm run browser
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 13.x
registry-url: https://npm.pkg.github.com/
- run: npm config set package-lock false
- run: npm install
- name: Get the version
id: get_version
run: |
api_version=$(echo ${GITHUB_REF/refs\/tags\//} | sed 's/releases\///g')
echo ::set-output name=VERSION::$api_version
- run: npm version --no-git-tag-version ${{ steps.get_version.outputs.VERSION }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test
name: Build and Test

on: [push]

jobs:
build:
test:
runs-on: ubuntu-latest

strategy:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meeco/cryppo",
"version": "0.3.4",
"version": "0.0.0-PLACEHOLDER",
"description": "In-browser encryption and decryption. Clone of Ruby Cryppo",
"scripts": {
"browser": "karma start",
Expand Down