Skip to content

Commit

Permalink
ci: automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack committed Sep 3, 2022
1 parent 3df3376 commit 1654328
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
workflow_run:
workflows: [test]
branches: [main]
types: [completed]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js, NPM
uses: actions/setup-node@v2
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
27 changes: 9 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
name: Test

on: push

on: [push, workflow_call]
jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

test:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
uses: actions/checkout@v3
- name: Install Node.js, NPM
uses: actions/setup-node@v2
with:
node-version: 15

node-version: 18
cache: npm
- name: npm install
run: npm ci

- name: npm test
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
run: npm test
run: NODE_OPTIONS=--openssl-legacy-provider npm test
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@
"jest": {
"preset": "ts-jest",
"testEnvironment": "node"
},
"release": {
"branches": [
"main"
]
}
}

0 comments on commit 1654328

Please sign in to comment.