-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ef10fc
commit 0ba8d7f
Showing
2 changed files
with
118 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Reusable build workflow | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
SSH_KEY: | ||
required: true | ||
KNOWN_HOSTS: | ||
required: true | ||
TS_OAUTH_SECRET: | ||
required: true | ||
TS_OAUTH_CLIENT_ID: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- NodeVersion: 14 | ||
OS: linux-latest | ||
- NodeVersion: 18 | ||
OS: linux-latest | ||
- NodeVersion: 16 | ||
OS: windows-latest | ||
- NodeVersion: 18 | ||
OS: windows-latest | ||
- NodeVersion: 16 | ||
OS: macos-latest | ||
- NodeVersion: 18 | ||
OS: macos-latest | ||
name: Node.js v${{ matrix.NodeVersion }} (${{ matrix.OS }}) | ||
runs-on: ${{ matrix.OS }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.NodeVersion }} | ||
|
||
- name: Connect to Tailscale | ||
uses: tailscale/github-action@v2 | ||
with: | ||
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | ||
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | ||
tags: tag:tinyburg-ci | ||
|
||
- name: Testing Server Online? | ||
run: | | ||
tailscale status | ||
tailscale ping ci.internal.tinyburg.app | ||
- name: Start ssh agent | ||
run: | | ||
eval "$(ssh-agent -s)" | ||
echo $SSH_AUTH_SOCK | ||
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> $GITHUB_ENV | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_KEY }} | ||
known_hosts: ${{ secrets.KNOWN_HOSTS }} | ||
|
||
- name: Add SSH key to agent | ||
run: | | ||
echo $SSH_AUTH_SOCK | ||
ssh-add -D | ||
ssh-add | ||
- name: Testing Server Reachable? | ||
run: ssh [email protected] "echo 'Hi, Mom!'" | ||
|
||
- if: runner.os == 'Linux' | ||
name: Start xvfb | ||
run: | | ||
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
echo "DISPLAY=:99" >> $GITHUB_ENV | ||
- name: Setup cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: common/temp/build-cache | ||
key: ${{ runner.os }}_node-${{ matrix.NodeVersion }}_build-cache | ||
|
||
- name: Verify Change Logs | ||
run: node common/scripts/install-run-rush.js change --verify | ||
|
||
- name: Rush Install | ||
run: | | ||
node common/scripts/install-run-rush.js install | ||
node common/scripts/install-run-rush.js update-autoinstaller --name rush-prettier | ||
node common/scripts/install-run-rush.js update-autoinstaller --name rush-commitlint | ||
- name: Rush build and test | ||
run: | | ||
node common/scripts/install-run-rush.js rebuild | ||
node common/scripts/install-run-rush.js test --timeline --production | ||
env: | ||
RUSH_BUILD_CACHE_ENABLED: 1 | ||
RUSH_BUILD_CACHE_WRITE_ALLOWED: 1 | ||
ARCHITECT_DOCKER_HOST: "ssh://[email protected]:22" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,78 +8,21 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Node.js v${{ matrix.NodeVersion }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
NodeVersion: [16, 18] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.NodeVersion }} | ||
|
||
- name: Connect to Tailscale | ||
uses: tailscale/github-action@v2 | ||
with: | ||
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | ||
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | ||
tags: tag:ci | ||
|
||
- name: Testing Server Online? | ||
run: | | ||
tailscale status | ||
tailscale ping ci.internal.tinyburg.app | ||
- name: Start ssh agent | ||
run: | | ||
eval "$(ssh-agent -s)" | ||
echo $SSH_AUTH_SOCK | ||
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> $GITHUB_ENV | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_KEY }} | ||
known_hosts: ${{ secrets.KNOWN_HOSTS }} | ||
call-workflow: | ||
uses: ./.github/workflows/build.yaml | ||
|
||
- name: Add SSH key to agent | ||
run: | | ||
echo $SSH_AUTH_SOCK | ||
ssh-add -D | ||
ssh-add | ||
- name: Testing Server Reachable? | ||
run: ssh [email protected] "echo 'Hi, Mom!'" | ||
|
||
- name: Verify Change Logs | ||
run: node common/scripts/install-run-rush.js change --verify | ||
deploy-authproxy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
- name: Setup cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
common/temp/build-cache | ||
packages/apks/downloads/apkmirror | ||
packages/apks/downloads/apkpure | ||
key: ${{ runner.os }}_node-${{ matrix.NodeVersion }}_build-cache | ||
deploy-auto-gold-bits: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
- name: Rush Install | ||
run: | | ||
node common/scripts/install-run-rush.js install | ||
node common/scripts/install-run-rush.js update-autoinstaller --name rush-prettier | ||
node common/scripts/install-run-rush.js update-autoinstaller --name rush-commitlint | ||
deploy-discord-bot: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
- name: Rush build and test | ||
run: | | ||
export DISPLAY=:99 | ||
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
node common/scripts/install-run-rush.js test --timeline --production | ||
env: | ||
RUSH_BUILD_CACHE_ENABLED: 1 | ||
RUSH_BUILD_CACHE_WRITE_ALLOWED: 1 | ||
ARCHITECT_DOCKER_HOST: "ssh://[email protected]:22" | ||
deploy-repl-demo: | ||
needs: build | ||
runs-on: ubuntu-latest |