This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
80 lines (76 loc) 路 2.56 KB
/
publish.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: publish
on:
workflow_dispatch:
inputs:
release_type:
description: "`alpha`, `alpha-minor`, `alpha-major`, `stable`, `stable-minor`, or `stable-major` release?"
required: true
default: "alpha"
jobs:
publish:
env:
RELEASE_TYPE: alpha
runs-on: ubuntu-latest
if: ${{ github.repository == 'grouparoo/grouparoo' }}
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BOT_GITHUB_PAT }}
fetch-depth: 0
- name: Update ENV
if: github.event.inputs.release_type != ''
run: echo "RELEASE_TYPE=${{ github.event.inputs.release_type }}" >> $GITHUB_ENV
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: git config --global user.email "hello@grouparoo.com"
- run: git config --global user.name "Grouparoo Bot"
- run: npm install -g pnpm
- name: publish
run: ./bin/publish $RELEASE_TYPE
env:
GITHUB_AUTH: ${{ secrets.BOT_GITHUB_PAT }}
NPM_TOKEN: ${{ secrets.BOT_NPM_TOKEN }}
update-lockfile:
runs-on: ubuntu-latest
if: ${{ github.repository == 'grouparoo/grouparoo' }}
needs: publish
steps:
- uses: actions/checkout@master
with:
ref: main
token: ${{ secrets.BOT_GITHUB_PAT }}
- name: Update PNPM lockfile
run: |
cd tools/merger && ./lockfile
- uses: stefanzweifel/git-auto-commit-action@v4.1.2
with:
commit_message: Updating lockfile [ci skip]
commit_user_name: Grouparoo Bot
commit_user_email: hello@grouparoo.com
commit_author: Grouparoo Bot <hello@grouparoo.com>
branch: main
notify-omnibus:
runs-on: ubuntu-latest
if: ${{ github.repository == 'grouparoo/grouparoo' }}
needs: publish
steps:
- name: Sleep
run: sleep 60
- name: Notifier auth
uses: getsentry/action-github-app-token@v1
id: notifier_auth
with:
app_id: ${{ secrets.OMNIBUS_NOTIFIER_APP_ID }}
private_key: ${{ secrets.OMNIBUS_NOTIFIER_APP_PRIVATE_KEY }}
- name: Notify
run: >-
curl
-X POST
-H "Authorization: token ${{ steps.notifier_auth.outputs.token }}"
-H "Accept: application/vnd.github.everest-preview+json"
-H "Content-Type: application/json"
https://api.github.com/repos/grouparoo/omnibus/actions/workflows/update.yml/dispatches
--data '{"ref": "main"}'