Skip to content

Commit

Permalink
ci: use release-please
Browse files Browse the repository at this point in the history
n
  • Loading branch information
Billlynch committed Oct 10, 2023
1 parent 0b33e61 commit 4e067fe
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 66 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build, Test, List

concurrency: deployment

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

jobs:
Setup-Environment:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile

Build:
runs-on: ubuntu-latest
needs: [Setup-Environment]
steps:
- run: yarn build

Test:
runs-on: ubuntu-latest
needs: [ Setup-Environment ]
steps:
- run: yarn test

Lint:
runs-on: ubuntu-latest
needs: [ Setup-Environment ]
steps:
- run: |
yarn format:check
yarn lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]

jobs:
build:
check-commit-message:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/Deploy.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/PR.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/Release-Please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
environment: deployment
strategy:
matrix:
node-version: [ 18.x ]
steps:
- uses: google-github-actions/release-please-action@v2
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main
monorepo-tags: true


Setup-Environment:
runs-on: ubuntu-latest
if: ${{ steps.release.outputs.releases_created }}
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile

Build:
runs-on: ubuntu-latest
if: ${{ steps.release.outputs.releases_created }}
needs: [ Setup-Environment ]
steps:
- run: yarn build

npm-publish:
runs-on: ubuntu-latest
if: ${{ steps.release.outputs.releases_created }}
needs: [Build]
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Publish to NPM
if: ${{ steps.release.outputs.releases_created }}
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
echo "@spotify-confidence:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc
yarn publish-if-missing
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "independent",
"packages": ["packages/*"],
"npmClient": "yarn",
"tagVersionPrefix": "-v",
"command": {
"version": {
"conventionalCommits": true,
Expand Down

0 comments on commit 4e067fe

Please sign in to comment.