Skip to content

Commit 93b7c4c

Browse files
committed
chore: let us try this again
1 parent dc413b2 commit 93b7c4c

File tree

7 files changed

+9025
-15482
lines changed

7 files changed

+9025
-15482
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,9 @@
1-
---
2-
name: CI & Release
3-
4-
# Workflow name based on selected inputs. Fallback to default Github naming when expression evaluates to empty string
5-
run-name: >-
6-
${{
7-
inputs.release && inputs.test && 'Build ➤ Test ➤ Publish to NPM' ||
8-
inputs.release && !inputs.test && 'Build ➤ Skip Tests ➤ Publish to NPM' ||
9-
github.event_name == 'workflow_dispatch' && inputs.test && 'Build ➤ Test' ||
10-
github.event_name == 'workflow_dispatch' && !inputs.test && 'Build ➤ Skip Tests' ||
11-
''
12-
}}
1+
name: CI
132

143
on:
154
pull_request:
165
push:
176
branches: [main]
18-
workflow_dispatch:
19-
inputs:
20-
test:
21-
description: 'Run tests'
22-
required: true
23-
default: true
24-
type: boolean
25-
release:
26-
description: 'Publish new release'
27-
required: true
28-
default: false
29-
type: boolean
307

318
concurrency:
329
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -46,7 +23,6 @@ jobs:
4623

4724
test:
4825
needs: build
49-
if: github.event.inputs.test != 'false'
5026
runs-on: ${{ matrix.os }}
5127
strategy:
5228
fail-fast: false
@@ -71,38 +47,3 @@ jobs:
7147
cache: npm
7248
- run: npm i
7349
- run: npm test
74-
75-
release:
76-
needs: [build, test]
77-
# only run if opt-in during workflow_dispatch
78-
if: always() && github.event.inputs.release == 'true' && needs.build.result != 'failure' && needs.test.result != 'failure' && needs.test.result != 'cancelled'
79-
runs-on: ubuntu-latest
80-
permissions:
81-
id-token: write
82-
steps:
83-
- uses: actions/create-github-app-token@v2
84-
id: app-token
85-
with:
86-
app-id: ${{ secrets.ECOSPARK_APP_ID }}
87-
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
88-
- uses: actions/checkout@v5
89-
with:
90-
# Need all history to analyze commits since last release
91-
fetch-depth: 0
92-
# Uses generated token to allow pushing commits back
93-
token: ${{ steps.app-token.outputs.token }}
94-
# Make sure GITHUB_TOKEN will not be persisted in repo's config
95-
persist-credentials: false
96-
- uses: actions/setup-node@v4
97-
with:
98-
cache: npm
99-
node-version: lts/*
100-
registry-url: 'https://registry.npmjs.org'
101-
# Ensure npm 11.5.1 or later is installed
102-
- name: Update npm
103-
run: npm install -g npm@latest
104-
- run: npm ci
105-
# Branches that will release new versions are defined in .releaserc.json
106-
- run: npm run release
107-
env:
108-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

.github/workflows/prettier.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-node@v4
18+
with:
19+
cache: npm
20+
node-version: 'lts/*'
21+
registry-url: 'https://registry.npmjs.org'
22+
# Ensure npm 11.5.1 or later is installed
23+
- name: Update npm
24+
run: npm install -g npm@latest
25+
- run: npm ci
26+
- run: npm publish
27+
working-directory: packages/gatsby-source-sanity

0 commit comments

Comments
 (0)