Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit b3c82be

Browse files
authoredOct 4, 2023
pkgx cdi/cd
1 parent 498bc41 commit b3c82be

File tree

7 files changed

+49
-70
lines changed

7 files changed

+49
-70
lines changed
 

‎.github/workflows/build-sign-notarize.yml

+11-22
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,25 @@ on:
1919
s3-electron-dist-key:
2020
description: "The S3 build key includes the installer files: [zip, dmg, etc, yml] from electron"
2121
value: ${{ jobs.build.outputs.s3-artifacts-key }}
22-
s3-custom-notarized-installers-key:
23-
description: "The S3 build key includes the installer files: [zip, dmg, etc, yml] from notarization strategy done outside of electron"
24-
value: ${{ jobs.build.outputs.s3-artifacts-key }}
2522
jobs:
2623
verify:
2724
runs-on: ubuntu-latest
2825
outputs:
2926
is-updated: ${{ steps.check_version.outputs.updated }}
3027
steps:
31-
- uses: teaxyz/setup@v0
32-
with:
33-
version: 0.35.7
3428
- uses: actions/checkout@v3
29+
- uses: pkgxdev/setup@v1
3530
with:
36-
fetch-depth: 5
31+
+: jq
3732
- name: Check if version in package.json was updated
3833
id: check_version
3934
run: |
4035
# Get the current version from package.json
4136
CURRENT_VERSION=$(jq -r .version package.json)
4237
43-
# Get the list of changed files between HEAD and the previous commit
44-
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
45-
46-
# If package.json is in the list of changed files, check the old version
47-
if echo "$CHANGED_FILES" | grep -q "package.json"; then
48-
OLD_VERSION=$(git show "HEAD^:package.json" | jq -r .version 2>/dev/null)
49-
else
50-
OLD_VERSION=$CURRENT_VERSION
51-
fi
38+
# Fetch the main branch
39+
git fetch origin main:main
40+
OLD_VERSION=$(git show "main:package.json" | jq -r .version 2>/dev/null)
5241
5342
if [[ "$OLD_VERSION" != "$CURRENT_VERSION" ]] && [[ "$CURRENT_VERSION" > "$OLD_VERSION" ]]; then
5443
echo "updated=true" >> $GITHUB_OUTPUT
@@ -66,13 +55,12 @@ jobs:
6655
if: needs.verify.outputs.is-updated == 'true'
6756
runs-on: macos-latest
6857
outputs:
58+
# just the postfix of the key, not the full key, github does not allow output of secrets
6959
s3-artifacts-key: ${{ steps.s3-artifact-uploader.outputs.key }}
7060
build-version: ${{ steps.gui-version.outputs.version }}
7161
steps:
72-
- uses: teaxyz/setup@v0
73-
with:
74-
version: 0.35.7
7562
- uses: actions/checkout@v3
63+
- uses: pkgxdev/dev@v0
7664

7765
- name: cache node_modules build
7866
# TODO: cache issue in our self-hosted macos runner ESPIPE: invalid seek, read
@@ -92,7 +80,7 @@ jobs:
9280
./svelte/build
9381
9482
- name: build
95-
run: tea -SE xc dist
83+
run: xc dist
9684
env:
9785
NOTARIZE: true
9886
PUBLIC_MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_PROJECT_TOKEN }}
@@ -127,7 +115,8 @@ jobs:
127115
id: s3-artifact-uploader
128116
env:
129117
prefix: ${{ inputs.s3-prefix }}
118+
bucket: ${{ secrets.BUILDS_S3_BUCKET }}
130119
run: |
131-
S3_KEY=s3://preview.gui.tea.xyz/$prefix/artifacts.tgz
120+
S3_KEY=$bucket/$prefix/artifacts.tgz
132121
aws s3 cp artifacts.tgz $S3_KEY
133-
echo key=$S3_KEY >> $GITHUB_OUTPUT
122+
echo "key=$prefix/artifacts.tgz" >> $GITHUB_OUTPUT

‎.github/workflows/ci.yml

+14-21
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ jobs:
3636
needs: changes
3737
runs-on: macos-latest
3838
steps:
39-
- uses: teaxyz/setup@v0
40-
with:
41-
version: 0.35.7
4239
- uses: actions/checkout@v3
40+
- uses: pkgxdev/dev@v0
4341
- name: cache node_modules build
4442
uses: actions/cache@v3
4543
with:
@@ -49,7 +47,7 @@ jobs:
4947
run: |
5048
cp .env.example svelte/.env
5149
- name: install app dependencies
52-
run: tea -E xc setup
50+
run: xc setup
5351
- name: test build electron main process
5452
run: npm run build:main
5553
# TODO: fix
@@ -67,10 +65,8 @@ jobs:
6765
# see: https://github.com/electron-userland/electron-builder/issues/3179
6866
USE_HARD_LINKS: false
6967
steps:
70-
- uses: teaxyz/setup@v0
71-
with:
72-
version: 0.35.7
7368
- uses: actions/checkout@v3
69+
- uses: pkgxdev/dev@v0
7470
- name: cache node_modules build
7571
uses: actions/cache@v3
7672
with:
@@ -79,9 +75,9 @@ jobs:
7975
- name: env file
8076
run: cp .env.example svelte/.env
8177
- name: install app dependencies
82-
run: tea -E xc setup
78+
run: xc setup
8379
- name: test build electron main process
84-
run: tea -E xc build
80+
run: xc build
8581
env:
8682
NOTARIZE: "false"
8783
CSC_IDENTITY_AUTO_DISCOVERY: "false"
@@ -91,16 +87,14 @@ jobs:
9187
mkdir -p /Users/runner/.tea/tea.xyz/gui
9288
touch /Users/runner/.tea/tea.xyz/gui/dev
9389
- name: e2e test
94-
run: tea -E xc e2e
90+
run: xc e2e
9591

9692
build_svelte:
9793
needs: changes
9894
runs-on: macos-latest
9995
steps:
100-
- uses: teaxyz/setup@v0
101-
with:
102-
version: 0.35.7
10396
- uses: actions/checkout@v3
97+
- uses: pkgxdev/dev@v0
10498
- name: cache node_modules build
10599
uses: actions/cache@v3
106100
with:
@@ -118,8 +112,7 @@ jobs:
118112
- name: get gui version
119113
id: gui-version
120114
run: |
121-
tea +stedolan.github.io/jq
122-
export version=$(echo $(cat package.json) | jq --raw-output .version)
115+
export version=$(echo $(cat package.json) | pkgx jq --raw-output .version)
123116
export postfix=
124117
if GIT_DIR=/path/to/repo/.git git rev-parse $1 >/dev/null 2>&1
125118
then
@@ -130,7 +123,7 @@ jobs:
130123
echo "version=$version$postfix" >> $GITHUB_OUTPUT
131124
132125
- name: build
133-
run: tea -E xc build:lite
126+
run: xc build:lite
134127
env:
135128
PUBLIC_VERSION: ${{ steps.gui-version.outputs.version }}
136129
BUILD_FOR: preview
@@ -232,10 +225,10 @@ jobs:
232225
- name: cp package images from prod to preview bucket
233226
env:
234227
prefix: ${{ needs.changes.outputs.preview_folder }}
228+
bucket: ${{ secrets.BUILDS_S3_BUCKET }}
235229
run: |
236230
cd dist && \
237-
aws s3 sync . \
238-
"s3://preview.gui.tea.xyz/$prefix/"
231+
aws s3 sync . "$bucket/$prefix/"
239232
240233
- name: comment install for Linux
241234
if: startsWith(matrix.platform.name, 'linux')
@@ -245,7 +238,7 @@ jobs:
245238
message: |
246239
**installer for Linux ${{ matrix.platform.name }} is at**:
247240
```bash
248-
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/${{ steps.build_platform.outputs.filename }}
241+
${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/${{ needs.changes.outputs.preview_folder }}/${{ steps.build_platform.outputs.filename }}
249242
```
250243
copy-paste into a browser to download
251244
@@ -257,7 +250,7 @@ jobs:
257250
message: |
258251
**installers for MacOS darwin+aarch64 is at**:
259252
```bash
260-
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/${{ steps.app_files.outputs.dmg_arm64 }}
253+
${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/${{ needs.changes.outputs.preview_folder }}/${{ steps.app_files.outputs.dmg_arm64 }}
261254
```
262255
copy-paste into a browser to download
263256
- name: comment install for MacOS
@@ -268,6 +261,6 @@ jobs:
268261
message: |
269262
**installers for MacOS darwin+x86-64 is at**:
270263
```bash
271-
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/${{ steps.app_files.outputs.dmg_x86 }}
264+
${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/${{ needs.changes.outputs.preview_folder }}/${{ steps.app_files.outputs.dmg_x86 }}
272265
```
273266
copy-paste into a browser to download

‎.github/workflows/cleanup.yml

-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,3 @@ jobs:
2424

2525
- name: remove distribution preview
2626
run: .github/remove-distribution.sh "${{ github.event.number }}-merge"
27-
28-
# consider to rm the folder later, maybe someone might need to download the installer
29-
# - name: remove s3 folder
30-
# run: aws s3 rm s3://preview.gui.tea.xyz/ --recursive --exclude "*" --include "${{ steps.preview.outputs.folder }}/*"

‎.github/workflows/main.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
secrets: inherit
2121
upload:
2222
needs: [build_desktop]
23-
if: needs.build_desktop.outputs.s3-custom-notarized-installers-key != ''
23+
if: needs.build_desktop.outputs.s3-electron-dist-key != ''
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
@@ -37,7 +37,7 @@ jobs:
3737
aws-region: us-east-1
3838
- name: s3 artifact download
3939
env:
40-
S3_INSTALLER_KEY: ${{ needs.build_desktop.outputs.s3-custom-notarized-installers-key }}
40+
S3_INSTALLER_KEY: ${{ secrets.BUILDS_S3_BUCKET }}/${{ needs.build_desktop.outputs.s3-electron-dist-key }}
4141
run: aws s3 cp $S3_INSTALLER_KEY dist.tgz
4242

4343
- run: |
@@ -97,10 +97,10 @@ jobs:
9797
env:
9898
arm64: ${{ steps.app_files.outputs.dmg_arm64 }}
9999
x86: ${{ steps.app_files.outputs.dmg_x86 }}
100+
bucket: ${{ secrets.BUILDS_S3_BUCKET }}
100101
run: |
101102
cd dist && \
102-
aws s3 sync . \
103-
"s3://preview.gui.tea.xyz/dev/"
103+
aws s3 sync . "$bucket/dev/"
104104
105105
- uses: actions/setup-node@v3
106106
with:
@@ -118,7 +118,7 @@ jobs:
118118
PLATFORM: darwin-aarch64
119119
EXT: dmg
120120
VERSION: ${{ steps.get-version.outputs.version }}-dev
121-
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/dev/${{ steps.app_files.outputs.dmg_arm64 }}
121+
DOWNLOAD_URL: ${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/dev/${{ steps.app_files.outputs.dmg_arm64 }}
122122

123123
- name: Slack Notification X86
124124
run: ./.github/notify-slack.js
@@ -127,7 +127,7 @@ jobs:
127127
PLATFORM: darwin-x86+64
128128
EXT: dmg
129129
VERSION: ${{ steps.get-version.outputs.version }}-dev
130-
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/dev/${{ steps.app_files.outputs.dmg_x86 }}
130+
DOWNLOAD_URL: ${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/dev/${{ steps.app_files.outputs.dmg_x86 }}
131131
- run: |
132132
aws cloudfront create-invalidation \
133133
--distribution-id ${{ secrets.AWS_CF_GUI_RELEASE_ID }} \

‎.github/workflows/release.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
aws-region: us-east-1
3636
- name: s3 artifact download
3737
env:
38-
S3_INSTALLER_KEY: ${{ needs.build_desktop.outputs.s3-electron-dist-key }}
38+
S3_INSTALLER_KEY: ${{ secrets.BUILDS_S3_BUCKET }}/${{ needs.build_desktop.outputs.s3-electron-dist-key }}
3939
run: aws s3 cp $S3_INSTALLER_KEY dist.tgz
4040

4141
- run: |
@@ -97,22 +97,23 @@ jobs:
9797
- name: cp latest as previous release
9898
run: |
9999
aws s3 cp \
100-
s3://dist.tea.xyz/tea.xyz/gui/tea-latest-arm64.dmg \
101-
s3://dist.tea.xyz/tea.xyz/gui/tea-previous-arm64.dmg
100+
$S3_BUCKET/release/ossapp-latest-arm64.dmg \
101+
$S3_BUCKET/release/ossapp-previous-arm64.dmg
102102
aws s3 cp \
103-
s3://dist.tea.xyz/tea.xyz/gui/tea-latest.dmg \
104-
s3://dist.tea.xyz/tea.xyz/gui/tea-previous.dmg
103+
$S3_BUCKET/release/ossapp-latest.dmg \
104+
$S3_BUCKET/release/ossapp-previous.dmg
105+
env:
106+
S3_BUCKET: ${{ secrets.BUILDS_S3_BUCKET }}
105107
- name: publish release
106108
run: |
107109
cd dist && \
108-
aws s3 sync . \
109-
"s3://preview.gui.tea.xyz/release/"
110-
aws s3 cp $ARM_URL s3://dist.tea.xyz/tea.xyz/gui/tea-latest-arm64.dmg
111-
aws s3 cp $X86_URL s3://dist.tea.xyz/tea.xyz/gui/tea-previous-arm64.dmg
110+
aws s3 sync . "$S3_BUCKET/release/"
111+
aws s3 cp $ARM_URL $S3_BUCKET/release/ossapp-latest-arm64.dmg
112+
aws s3 cp $X86_URL $S3_BUCKET/release/ossapp-latest.dmg
112113
env:
113-
ARM_URL: s3://preview.gui.tea.xyz/release/${{ steps.app_files.outputs.dmg_arm64 }}
114-
X86_URL: s3://preview.gui.tea.xyz/release/${{ steps.app_files.outputs.dmg_x86 }}
115-
114+
ARM_URL: ${{ secrets.BUILDS_S3_BUCKET }}/release/${{ steps.app_files.outputs.dmg_arm64 }}
115+
X86_URL: ${{ secrets.BUILDS_S3_BUCKET }}/release/${{ steps.app_files.outputs.dmg_x86 }}
116+
S3_BUCKET: ${{ secrets.BUILDS_S3_BUCKET }}
116117
- run: |
117118
aws cloudfront create-invalidation \
118119
--distribution-id ${{ secrets.AWS_GUI_DISTRIBUTION_ID }} \
@@ -128,7 +129,7 @@ jobs:
128129
PLATFORM: darwin+aarch64
129130
VERSION: ${{steps.tag.outputs.tag}}
130131
EXT: "${{ steps.build_platform.outputs.extension }}"
131-
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/${{ steps.app_files.outputs.dmg_arm64 }}
132+
DOWNLOAD_URL: ${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/release/${{ steps.app_files.outputs.dmg_arm64 }}
132133

133134
- name: Slack Notification X86 Build
134135
run: ./.github/notify-slack.js
@@ -137,7 +138,7 @@ jobs:
137138
PLATFORM: darwin+x86-64
138139
VERSION: ${{steps.tag.outputs.tag}}
139140
EXT: ${{ steps.build_platform.outputs.extension }}
140-
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/${{ steps.app_files.outputs.dmg_x86 }}
141+
DOWNLOAD_URL: ${{ secrets.BUILDS_S3_PUBLIC_DOMAIN }}/release/${{ steps.app_files.outputs.dmg_x86 }}
141142

142143
- run: |
143144
aws cloudfront create-invalidation \

‎devops/ubuntu/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh -l
22
tea -SE .
3-
tea -ES xc build
3+
pkgx xc build

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ossapp",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"private": true,
55
"description": "The Open Source App Store",
66
"author": "pkgx inc. <hello@pkgx.dev>",
@@ -147,5 +147,5 @@
147147
},
148148
"homepage": "https://pkgx.app",
149149
"repository": "https://github.com/pkgxdev/ossapp.git",
150-
"tea": "node^18.16 npm^9.7.2 python^3.11 xc make"
150+
"pkgx": "node^18.16 npm^9.7.2 python@3.11 xc make"
151151
}

0 commit comments

Comments
 (0)
This repository has been archived.