Skip to content

Commit

Permalink
Adding CI files
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielrizzo committed Sep 14, 2021
1 parent f8194fe commit 772b031
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/new-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: deploy

on:
release:
types: [ created ]

jobs:
deploy:
if: ${{ contains(github.ref, 'refs/tags/release-') }}
runs-on: ubuntu-latest
steps:
# GET TAG VERSION & RELEASE_VERSION IN $GITHUB_ENV
- name: Get TAG_VERSION & RELEASE_VERSION
run: |
echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/release-}" >> $GITHUB_ENV
# CHECKOUT REPOSITORY
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: main
# SETUP NODE ENV W/ NPM PUBLIC REGISTRY
- name: Setup Node Env
uses: actions/setup-node@v2
with:
registry-url: 'https://registry.npmjs.org'
# CONFIGURE GIT
- name: Configure Git
run: |
git config user.name github-ci
git config user.email [email protected]
# RUN SCRIPTS
- name: Update package version
run: node -e "let pkg=require('./package.json'); pkg.version='${{ env.RELEASE_VERSION }}'; require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
- name: Build Package
run: |
npm install
npm run build
# PUBLISH VUE PACKAGE
- name: Publish VueJS Package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# ADD & COMMIT CHANGES
- name: Add & Commit Changes
run: |
git add .
git commit -am "[github-ci] Published Version"
git push origin main:npm --force
# TAG VERSION
- name: Tag Version
run: |
git tag -a ${{ env.TAG_VERSION }} -m ${{ env.TAG_VERSION }} --force
git push --tags --force
# SUCCESS MESSAGE TO DISCORD
- name: Success Message to Discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.WEBHOOK_URL }}
title: "Published @yoonit/rxjs-yoonit-store v${{ env.RELEASE_VERSION }}"
description: |
A new release has been published:
[Click here to go to the release page](https://github.com/Yoonit-Labs/rxjs-yoonit-store/releases/tag/${{ env.TAG_VERSION }})
color: 0x00ff00
username: GitHub Actions
21 changes: 21 additions & 0 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: run_test:unit

on: [push, workflow_dispatch]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test:unit

0 comments on commit 772b031

Please sign in to comment.