Skip to content

Commit 054c8e6

Browse files
authored
docs(docs): resolve issue with shopping list docs (#744)
1 parent a0dda50 commit 054c8e6

File tree

3 files changed

+252
-43
lines changed

3 files changed

+252
-43
lines changed

.github/workflows/release.yml

+55-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
contents: write
1616
outputs:
1717
latest_commit: ${{ steps.git_remote.outputs.latest_commit }}
18+
skip_release: ${{ steps.should_skip_release.outputs.skip_release }}
1819
env:
1920
CI: "true"
2021
steps:
@@ -41,6 +42,9 @@ jobs:
4142
- name: Check for new commits
4243
id: git_remote
4344
run: echo "latest_commit=$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT
45+
- name: Should skip release
46+
id: should_skip_release
47+
run: echo "skip_release=$(git log --oneline -1 | grep -qE 'docs\(?.*\)?:|chore\(?.*\)?:|refactor\(?.*\)?:|test\(?.*\)?:' && echo true || echo false)" >> $GITHUB_OUTPUT
4448
- name: Extract Dists
4549
run: rsync -a . ./dist --include="*/" --include="/docs/dist/**" --include="/packages/pdk/dist/**" --exclude="*" --prune-empty-dirs
4650
- name: Upload artifact
@@ -55,7 +59,7 @@ jobs:
5559
runs-on: ubuntu-latest
5660
permissions:
5761
contents: write
58-
if: needs.release.outputs.latest_commit == github.sha
62+
if: needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
5963
steps:
6064
- uses: actions/setup-node@v2
6165
with:
@@ -77,8 +81,10 @@ jobs:
7781
needs: release
7882
runs-on: ubuntu-latest
7983
permissions:
84+
id-token: write
85+
issues: write
8086
contents: read
81-
if: needs.release.outputs.latest_commit == github.sha
87+
if: needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
8288
steps:
8389
- name: Install Node.js
8490
uses: actions/setup-node@v3
@@ -95,16 +101,32 @@ jobs:
95101
working-directory: dist/packages/pdk
96102
run: pnpm --package publib@latest dlx publib-npm
97103
env:
104+
NPM_CONFIG_PROVENANCE: "true"
98105
NPM_DIST_TAG: latest
99106
NPM_REGISTRY: registry.npmjs.org
100107
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
108+
- name: Extract Version
109+
id: extract-version
110+
working-directory: dist/packages/pdk
111+
if: ${{ failure() }}
112+
run: echo "VERSION=$(cat dist/releasetag.txt)" >> $GITHUB_OUTPUT
113+
- name: Create Issue
114+
if: ${{ failure() }}
115+
uses: imjohnbo/issue-bot@v3
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
with:
119+
labels: failed-release
120+
title: Publishing v${{ steps.extract-version.outputs.VERSION }} to npm failed
121+
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
101122
release_maven:
102123
name: Publish to Maven Central
103124
needs: release
104125
runs-on: ubuntu-latest
105126
permissions:
127+
issues: write
106128
contents: read
107-
if: needs.release.outputs.latest_commit == github.sha
129+
if: needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
108130
steps:
109131
- uses: actions/setup-java@v2
110132
with:
@@ -131,13 +153,28 @@ jobs:
131153
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
132154
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
133155
MAVEN_STAGING_PROFILE_ID: ${{ secrets.MAVEN_STAGING_PROFILE_ID }}
156+
- name: Extract Version
157+
id: extract-version
158+
working-directory: dist/packages/pdk
159+
if: ${{ failure() }}
160+
run: echo "VERSION=$(cat dist/releasetag.txt)" >> $GITHUB_OUTPUT
161+
- name: Create Issue
162+
if: ${{ failure() }}
163+
uses: imjohnbo/issue-bot@v3
164+
env:
165+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166+
with:
167+
labels: failed-release
168+
title: Publishing v${{ steps.extract-version.outputs.VERSION }} to maven failed
169+
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
134170
release_pypi:
135171
name: Publish to PyPI
136172
needs: release
137173
runs-on: ubuntu-latest
138174
permissions:
139175
contents: read
140-
if: needs.release.outputs.latest_commit == github.sha
176+
issues: write
177+
if: needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
141178
steps:
142179
- name: Install Node.js
143180
uses: actions/setup-node@v3
@@ -159,6 +196,20 @@ jobs:
159196
env:
160197
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
161198
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
199+
- name: Extract Version
200+
id: extract-version
201+
working-directory: dist/packages/pdk
202+
if: ${{ failure() }}
203+
run: echo "VERSION=$(cat dist/releasetag.txt)" >> $GITHUB_OUTPUT
204+
- name: Create Issue
205+
if: ${{ failure() }}
206+
uses: imjohnbo/issue-bot@v3
207+
env:
208+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
209+
with:
210+
labels: failed-release
211+
title: Publishing v${{ steps.extract-version.outputs.VERSION }} to pypi failed
212+
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
162213
release_docs:
163214
needs: release_github
164215
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)