-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.63 KB
/
changeset-release.yml
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
---
name: Changeset Release
# yamllint disable rule:truthy
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions: read-all
jobs:
release:
# IMPORTANT: prevent this action from running on forks
if: github.repository == 'chizovation/changesets-changelog-info'
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Changeset Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
token: ${{ secrets.CHANGESETS_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: yarn
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
with:
title: Release Changeset (bake CHANGELOG.md)
# we use ourself to get the information for the release
- name: Get Change Info
uses: ./
id: get-changelog-info
- name: Push Tags
# https://github.com/changesets/action#custom-publishing
if: steps.changesets.outputs.hasChangesets == 'false'
shell: bash
run: |
git tag ${{ steps.get-changelog-info.outputs.last-change-version-v }}
# this could fail in a merge without changesets
# (e.g. update README.md, merge)
# but that's a bit naughty anyway, so we'll let it fail
git push --tags