-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.15 KB
/
publish-manually.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
name: Manually Publish npm Packages
on:
workflow_dispatch:
inputs:
version_type:
description: Choose a version type to bump the package version by.
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
- prerelease
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Generate GitHub App Token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.ORG_GH_RONIN_APP_ID }}
private_key: ${{ secrets.ORG_GH_RONIN_APP_PRIVATE_KEY }}
- name: Code Checkout
uses: actions/[email protected]
with:
token: ${{ steps.generate_token.outputs.token }}
# Needed only for bumping package version and publishing npm packages.
- name: Set up Node.js
uses: actions/[email protected]
- run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN_READ_AND_WRITE }}' > ~/.npmrc
- name: Set up Bun
uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Build Package
run: bun run build
- name: Set Git Config
run: |
# See where these config values come from at https://stackoverflow.com/a/74071223
git config --global user.name "ronin-app[bot]"
git config --global user.email 135042755+ronin-app[bot]@users.noreply.github.com
- name: Bump `react-ronin`
run: |
npm version ${{ inputs.version_type }} --git-tag-version=false
echo "NEW_VERSION=$(npm pkg get version --workspaces=false | tr -d \")" >> $GITHUB_ENV
- name: Push New Version
run: |
git fetch
git checkout ${GITHUB_HEAD_REF}
git pull origin ${GITHUB_HEAD_REF}
git commit -a -m '${{ env.NEW_VERSION }}' --no-verify
git tag -a ${{ env.NEW_VERSION }} -m '${{ env.NEW_VERSION }}'
git push origin ${GITHUB_HEAD_REF}
# Push tag
git push origin ${{ env.NEW_VERSION }}
- name: Publish npm Package
run: npm publish