-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nrdobie/setup-publish
ci: enabling auto-publish with semantic release
- Loading branch information
Showing
5 changed files
with
1,422 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: publish | ||
concurrency: | ||
group: publish-${{ github.github.base_ref }} | ||
cancel-in-progress: true | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
- beta | ||
- alpha | ||
jobs: | ||
test-and-publish: | ||
name: Test and Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
depth: 0 | ||
- uses: pnpm/action-setup@v2 | ||
name: Install PNPM | ||
with: | ||
version: 8 | ||
run_install: false | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Get PNPM store directory | ||
id: pnpm-store | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- uses: actions/cache@v3 | ||
name: Setup PNPM cache | ||
with: | ||
path: ${{ steps.pnpm-store.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
- uses: actions/setup-node@v4 | ||
name: Setup Node.js | ||
with: | ||
node-version: 20 | ||
- name: Run lint | ||
run: pnpm run ci:lint | ||
- name: Build Prisma Test DB | ||
run: pnpm exec prisma db push | ||
- name: Run tests | ||
run: pnpm run ci:test | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: pnpm exec semantic-release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"branches": ["main", "next", { "name": "beta", "prerelease": true }, { "name": "alpha", "prerelease": true }], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.