2022-02-02 20:03:38 +00:00
|
|
|
name: Nightly
|
2022-02-02 19:07:27 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'scripts/**'
|
2022-02-16 15:09:27 +00:00
|
|
|
- 'poly/**'
|
2022-02-02 19:07:27 +00:00
|
|
|
- '.github/workflows/**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup Node.js v16.x
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
|
|
|
|
- name: Pack base asar
|
|
|
|
run: |
|
2022-02-02 20:03:38 +00:00
|
|
|
npm i -g asar
|
2022-02-02 19:07:27 +00:00
|
|
|
bash scripts/injectPolyfills.sh
|
|
|
|
sed -i -e "s/nightly/nightly-$(git rev-parse HEAD | cut -c 1-7)/" src/index.js
|
2022-02-07 08:17:04 +00:00
|
|
|
node scripts/strip.js
|
2022-02-02 19:07:27 +00:00
|
|
|
npx asar pack src app.asar
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: built-asar
|
|
|
|
path: app.asar
|
|
|
|
retention-days: 1
|
|
|
|
|
|
|
|
test:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Retrieve artifact
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: built-asar
|
2022-02-02 19:22:58 +00:00
|
|
|
path: artifact
|
|
|
|
|
|
|
|
- name: Extract artifact
|
|
|
|
run: |
|
|
|
|
cp artifact/app.asar .
|
2022-02-02 19:07:27 +00:00
|
|
|
|
|
|
|
- name: Setup Node.js v16.x
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
|
|
|
|
- name: Download Client with OpenAsar
|
|
|
|
run: |
|
|
|
|
wget "https://discord.com/api/download/canary?platform=linux&format=tar.gz" -O discord.tar.gz
|
|
|
|
tar xf discord.tar.gz
|
|
|
|
cp app.asar DiscordCanary/resources/app.asar
|
|
|
|
|
|
|
|
- name: Check if Discord will startup
|
|
|
|
run: |
|
2022-02-06 21:33:04 +00:00
|
|
|
coproc { xvfb-run -e /dev/stdout ./DiscordCanary/DiscordCanary --enable-logging; }
|
|
|
|
grep -m1 "Installing discord_rpc" <&${COPROC[0]}
|
|
|
|
sleep 1
|
|
|
|
[[ $COPROC_PID ]] && kill $COPROC_PID
|
2022-02-02 19:44:55 +00:00
|
|
|
timeout-minutes: 1
|
2022-02-02 19:07:27 +00:00
|
|
|
|
|
|
|
release:
|
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Retrieve artifact
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: built-asar
|
2022-02-02 19:27:09 +00:00
|
|
|
path: artifact
|
|
|
|
|
|
|
|
- name: Extract artifact
|
|
|
|
run: |
|
|
|
|
cp artifact/app.asar .
|
2022-02-02 19:07:27 +00:00
|
|
|
|
|
|
|
- name: GitHub Release
|
|
|
|
run: |
|
2022-02-15 20:28:55 +00:00
|
|
|
git tag -d nightly || true
|
|
|
|
git push origin --delete nightly || true
|
2022-02-02 19:07:27 +00:00
|
|
|
git tag nightly
|
|
|
|
git push origin nightly
|
2022-02-15 20:09:28 +00:00
|
|
|
gh release delete ${{ env.VERSION }} -y || true
|
2022-02-15 20:04:58 +00:00
|
|
|
gh release create ${{ env.VERSION }} -t "Nightly" -n "$(git rev-parse HEAD | cut -c 1-7) | $(git log -1 --pretty=%B)" ${{ env.FILES }}
|
2022-02-02 19:07:27 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
VERSION: 'nightly'
|
|
|
|
NAME: 'Nightly'
|
|
|
|
#FILES: app.asar minified_testing_dont_use.asar
|
2022-02-03 23:06:49 +00:00
|
|
|
FILES: app.asar
|