-
Notifications
You must be signed in to change notification settings - Fork 310
57 lines (47 loc) · 1.38 KB
/
version.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
name: version
on:
push:
branches:
- main
tags-ignore:
- '**'
paths-ignore:
- '**.md'
workflow_dispatch:
env:
COMMIT_USER: Hiro DevOps
COMMIT_EMAIL: [email protected]
jobs:
pre-run:
uses: ./.github/workflows/pre-run.yml
secrets: inherit
version:
runs-on: ubuntu-latest
needs: pre-run
if: "needs.pre-run.outputs.is-not-fork == 'true' && !contains(github.event.head_commit.message, 'chore: version packages')"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install -g npm@latest
- run: npm ci
# workaround for changesets/action to allow not using changesets
# todo: add `force` option on fork to allow removing this workaround
- run: |
npx changeset init
npx changeset --empty
echo '.changeset/' >> .git/info/exclude
- run: git tag -d $(git tag | grep 'beta')
- name: Create Release Pull Request
uses: janniks/changesets-action@main
with:
title: 'chore: version packages'
commit: 'chore: version packages'
version: 'npm run ci:version'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}