Skip to content

Commit

Permalink
chore: add workflow to release a new version
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jun 17, 2021
1 parent 820859a commit 7aaf17d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Release
on:
workflow_dispatch:
inputs:
release:
description: 'type "release" to confirm creating a new release (main branch only)'
required: false
jobs:
release:
name: Release version
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Find cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Lint package
run: yarn lint
- name: Test package
run: yarn test
- name: Build clean
run: yarn clean
- name: Build package
run: yarn build
- name: Test-run release
if: success() && github.event.inputs.release != 'release'
run: yarn semantic-release --dry-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: success() && github.ref == 'refs/heads/main' && github.event.inputs.release == 'release'
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7aaf17d

Please sign in to comment.