-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (69 loc) · 2.41 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
81
82
83
84
85
name: Publish
on:
workflow_call:
push:
branches:
- main
# - develop - Uncomment this line to enable publishing from the develop branch. On hold until Mercury-Rising is complete.
jobs:
lint-test-build:
uses: ./.github/workflows/lint-test-build.yml
publish:
needs: [lint-test-build]
runs-on: ubuntu-latest
steps:
# # Setup Auth token to push to github packages
- name: Set NPM Config
run: npm config set '//npm.pkg.github.com/:_authToken=${{ secrets.ACCESS_TOKEN }}'
- name: Add safe directory
run: git config --global --add safe.directory /__w/sage-lib/sage-lib
- name: Clone Sage-Lib Repo
uses: actions/checkout@v4
with:
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: "0"
# Setup Git Credentials to come from the Bot
- name: Set Bot Email
run: git config user.email "[email protected]"
- name: Set Bot Name
run: git config user.name "Kajabi Automation Bot"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
version: v0.9.1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.7'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://npm.pkg.github.com
- name: Yarn Install
run: yarn install --frozen-lockfile
- name: Lerna Boostrap
run: yarn lerna bootstrap --ci
- name: Set PreId
id: set_preid
run: |
if [ "${{ github.ref }}" == "refs/heads/develop" ]; then
echo "preid='rc'" >> $GITHUB_OUTPUT
else
echo "preid=''" >> $GITHUB_OUTPUT
fi
- name: Lerna Version Develop
if: github.ref == 'refs/heads/develop'
run: NODE_OPTIONS=--openssl-legacy-provider yarn lerna publish --canary --yes --preid rc
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Lerna Publish
if: github.ref == 'refs/heads/main'
run: NODE_OPTIONS=--openssl-legacy-provider yarn lerna publish --registry github --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
deploy:
needs: publish
if: github.ref == 'refs/heads/develop'
uses: ./.github/workflows/release-deploy.yml
secrets: inherit