Skip to content

Commit

Permalink
feat: create the tag and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tsyirvo committed Jan 4, 2021
1 parent e153d9e commit 534529c
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 44 deletions.
86 changes: 43 additions & 43 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: Quality

on:
pull_request:
branches:
- develop

jobs:
quality:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '10.23.0'

- name: Check node_modules cache
uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install JS dependencies if not cached
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn

- name: Run quality checks
run: |
yarn test
yarn tsc
yarn lint
- name: Run DangerJS
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
run: yarn danger ci
# name: Quality

# on:
# pull_request:
# branches:
# - develop

# jobs:
# quality:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repo
# uses: actions/checkout@v2

# - name: Setup NodeJS
# uses: actions/setup-node@v2
# with:
# node-version: '10.23.0'

# - name: Check node_modules cache
# uses: actions/cache@v2
# id: yarn-cache
# with:
# path: node_modules
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-

# - name: Install JS dependencies if not cached
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn

# - name: Run quality checks
# run: |
# yarn test
# yarn tsc
# yarn lint

# - name: Run DangerJS
# env:
# DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
# run: yarn danger ci
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Create a release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
34 changes: 34 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tag

on:
pull_request:
types:
- labeled

jobs:
tag:
if: ${{ github.event.label.name == 'deployed' }}
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Setup Git credentials
run: |
git config user.email "$(git log --format='%ae' HEAD^!)"
git config user.name "$(git log --format='%an' HEAD^!)"
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '10.23.0'

- name: Update the app version and tag it
run: npx standard-version

- name: Commit the changes
run: git push --follow-tags
2 changes: 1 addition & 1 deletion .versionrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const iOSUpdater = regexpUpdater(iOSVersionRegexp);
const androidUpdater = regexpUpdater(androidVersionRegexp);

module.exports = {
releaseCommitMessageFormat: 'chore(release): v{{currentTag}} [skip ci]',
releaseCommitMessageFormat: 'chore(release): v{{currentTag}}',
bumpFiles: [
{
filename: 'package.json',
Expand Down

0 comments on commit 534529c

Please sign in to comment.