-
Notifications
You must be signed in to change notification settings - Fork 282
44 lines (41 loc) · 1.33 KB
/
publish.yml
File metadata and controls
44 lines (41 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Publish Packages
on:
workflow_dispatch:
concurrency: version-or-publish-${{ github.ref }}
jobs:
publish:
name: Publish Packages
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0 # To get all tags
ref: ${{ github.ref }}
- name: Set up environment
uses: ./.github/actions/setup
- name: Create Prepare Release PR or Publish
id: changesets
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
with:
title: Prepare Release
commit: Prepare Release
version: npm run version
publish: npm run publish
commitMode: github-api
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check changesets status
if: steps.changesets.outputs.hasChangesets == 'true'
run: |
echo "Changesets found. Merge Prepare Release PR before publishing."
exit 1
- name: Check publish status
if: steps.changesets.outputs.published == 'false'
run: |
echo "Publish failed. Check the logs for more details."
exit 1