-
Notifications
You must be signed in to change notification settings - Fork 53
83 lines (73 loc) · 2.7 KB
/
Copy pathchangeset.yml
File metadata and controls
83 lines (73 loc) · 2.7 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Changeset (Release)
on:
push:
branches:
- master
permissions:
contents: write
deployments: read
pull-requests: write
statuses: write
packages: write
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
release:
name: Release
environment: main
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
persist-credentials: false
- name: Use Node.js
uses: ./.github/actions/setup-node
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: has changeset file
id: changesetfiles
run: |
count=$(find .changeset -name "*.md" -type f | wc -l)
echo "count=$count" >> $GITHUB_OUTPUT
if [ $count -gt 0 ]; then
echo "Found $count md file(s)"
find .changeset -name "*.md" -type f
else
echo "No md files found"
fi
- name: Install and Build
if: steps.changesetfiles.outputs.count == 1
run: |
pnpm install --frozen-lockfile
pnpm build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install but do not build
if: steps.changesetfiles.outputs.count > 1
run: pnpm install --ignore-scripts --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d #v1.9.0
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
commit: "chore: prepare release"
title: "chore: prepare release"
env:
GITHUB_TOKEN: ${{ secrets.CHANGESET_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
update-cdn-content:
needs: release
environment: main
runs-on: ubuntu-latest
steps:
- run: |
curl -XPOST -u "build-travis-ci:${{ secrets.CDN_CONTENT_PAT }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/talend/cdn-content/actions/workflows/download-talend-ui.yml/dispatches --data '{"ref": "main"}'