Skip to content

Commit

Permalink
chore: add semantic-release and renovate (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokahler committed May 17, 2024
1 parent b9b2b7d commit 958b7c4
Show file tree
Hide file tree
Showing 6 changed files with 10,127 additions and 2,906 deletions.
4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>sanity-io/renovate-config"]
}
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release
on:
push:
branches:
- main
- alpha

jobs:
release:
name: Release
environment:
name: npm-production
runs-on: ubuntu-latest
permissions:
contents: read # for checkout
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.ECOSPARK_APP_ID }}
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
# Need all history to analyze commits since last release
fetch-depth: 0
# Uses generated token to allow pushing commits back
token: ${{ steps.app-token.outputs.token }}
# Make sure GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm t

- name: Release
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: npx semantic-release
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test
on:
- pull_request

jobs:
release:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm t
4 changes: 4 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@sanity/semantic-release-preset",
"branches": ["main", {"name": "alpha", "prerelease": true}]
}

0 comments on commit 958b7c4

Please sign in to comment.