-
Notifications
You must be signed in to change notification settings - Fork 41
80 lines (78 loc) · 2.69 KB
/
publish-internal.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 to Chrome WebStore (Trusted Testers)
on:
schedule:
# Runs every day at midnight
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.REPO_TOKEN }}
- name: Check for new commits
run: |
last_commit=$(git log -1 --pretty=%B)
if [[ "$last_commit" == *"Version Bump (Internal)"* ]]; then
echo "No new commits. Canceling publish..."
exit 1
fi
- uses: actions/setup-node@v4
with:
node-version: "20.16.0"
cache: 'yarn'
- name: Install deps via Yarn
run: yarn setup
- uses: actions/checkout@v4
with:
repository: 'rainbow-me/browser-extension-env'
token: ${{ secrets.DOTENV_GITHUB_ACCESS_TOKEN }}
path: tmp
- name: Copy dotenv
run: cat tmp/dotenv >> .env && rm -rf tmp
- name: Mark the build as internal
run: echo "INTERNAL_BUILD=true" >> .env
- name: Bump the version
run: yarn bump
- name: Fetch the current version number
run: echo "release_version=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
- name: Build the extension ready for the stores
run: yarn build:webpack
- name: Update the manifest
run: yarn update-manifest internal
- name: Zip it
run: yarn zip
- name: Archive the build artifact
uses: actions/upload-artifact@v4
with:
name: rainbowbx-v${{ env.release_version }}
path: build/
- name: Submit to the chrome webstore
uses: PlasmoHQ/bpp@v3
with:
artifact: ./rainbowbx.zip
keys: ${{ secrets.BPP_KEYS_INTERNAL }}
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: Version Bump (Internal) - v${{ env.release_version }}
committer_name: GitHub Actions
committer_email: [email protected]
add: '*.json'
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: internal
finalize: true
sourcemaps: ./build
version: ${{ env.release_version }}
url_prefix: 'chrome-extension://kajddphdgkbiifcaichanbfjgmfaneem'