Skip to content

Commit

Permalink
ci: add semantic-release integration
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenOutman committed Mar 30, 2022
1 parent ec01ab8 commit ed44d13
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
56 changes: 27 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [main]
branches: [main, beta]
pull_request:
branches: [main]

Expand Down Expand Up @@ -48,31 +48,29 @@ jobs:
- name: Build and Test
run: pnpm test

# Uncomment this job when ready to semantic-release
#
# release:
# runs-on: ubuntu-latest
# needs: ["test"]
# if: "!contains(github.event.head_commit.message, 'skip-release') && !contains(github.event.head_commit.message, 'skip-ci') && github.event_name != 'pull_request'"
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14.x
# - name: Cache ~/.pnpm-store
# uses: actions/cache@v2
# env:
# cache-name: cache-pnpm-store
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-
# ${{ runner.os }}-${{ matrix.node-version }}-release-
# ${{ runner.os }}-
# - run: npm i -g pnpm
# - run: pnpm i
# - run: pnpx -y semantic-release --branches main
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
runs-on: ubuntu-latest
needs: ["test"]
if: "!contains(github.event.head_commit.message, 'skip-release') && !contains(github.event.head_commit.message, 'skip-ci') && github.event_name != 'pull_request'"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Cache ~/.pnpm-store
uses: actions/cache@v2
env:
cache-name: cache-pnpm-store
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-release-
${{ runner.os }}-
- run: npm i -g pnpm
- run: pnpm i
- run: pnpx -y semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
"type": "git",
"url": "git+https://github.com/rsuite/formik.git"
},
"release": {
"branches": [
"main",
{
"name": "beta",
"prerelease": true
}
]
},
"keywords": [],
"author": "Doma <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit ed44d13

Please sign in to comment.