From f9a287de42c8e8f6f1fedcfb2514b89b6350ef9b Mon Sep 17 00:00:00 2001 From: Gabriel Hofman Date: Mon, 4 Jan 2021 09:55:10 +0100 Subject: [PATCH] feat: create the tag and release workflow --- .github/workflows/quality.yml | 86 +++++++++++++++++------------------ .github/workflows/release.yml | 22 +++++++++ .github/workflows/tag.yml | 33 ++++++++++++++ .versionrc.js | 2 +- 4 files changed, 99 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 4ce66280..adef83be 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..80cd716b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +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 }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..9d0abeab --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,33 @@ +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: + 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 diff --git a/.versionrc.js b/.versionrc.js index 8389ce7e..5dce9019 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -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',