Build Nightly #1175
This file contains hidden or 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
name: Build Nightly | |
# run at midnight, every night | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
getInfo: | |
name: Get build Info | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.getinfo.outputs.version }} | |
patchnotes: ${{ steps.getinfo.outputs.patchnotes }} | |
dobuild: ${{ steps.dobuild.outputs.dobuild }} | |
steps: | |
- name: Checkout crowbartools/firebot:v5 | |
uses: actions/checkout@v4 | |
with: | |
clean: false | |
fetch-depth: 0 | |
repository: 'crowbartools/firebot' | |
ref: 'v5' | |
path: '.' | |
- name: Checkout crowbartools/firebot-nightly | |
uses: actions/checkout@v4 | |
with: | |
path: './nightly/' | |
- name: Get commit messages | |
id: commits | |
shell: bash | |
run: | | |
pwd | |
git status | |
git log --pretty=format:'- %s' --branches=v5 $(git describe --tags `git rev-list --tags --max-count=1`)..HEAD >> commits.txt | |
echo "$(<commits.txt)" | |
- name: Get Firebot info | |
id: getinfo | |
run: node ./nightly/scripts/get-info.js $GITHUB_OUTPUT | |
- name: Check if there are new commits | |
id: dobuild | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
continue-on-error: true | |
run: test -z "$(git rev-list --since="24 hours" $(git show -s --format=%H))" && echo "dobuild=false" >> $GITHUB_OUTPUT | |
compile: | |
name: 'Compile' | |
needs: [getInfo] | |
if: needs.getInfo.outputs.dobuild != 'false' | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Firebot repo | |
uses: actions/checkout@v4 | |
with: | |
clean: false | |
repository: 'crowbartools/firebot' | |
ref: 'v5' | |
path: '.' | |
- name: Checkout Nightly Repo | |
uses: actions/checkout@v4 | |
with: | |
path: './nightly/' | |
- name: Install Python deps | |
run: python -m pip install --upgrade packaging pip setuptools | |
- name: Setup Nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.14.0' | |
- name: Install correct npm version | |
run: npm install -g [email protected] | |
- name: Linux Build Prep | |
if: runner.os == 'linux' | |
run: sudo apt-get install libx11-dev libxtst-dev libpng-dev | |
- name: MacOS Build Prep | |
if: runner.os == 'macOS' | |
# Force install this dep until node-appdmg then electron-installer-dmg gets updated | |
# appdmg will fail to install without python setuptools since gh runners now use python 3.12. See: https://github.com/electron/forge/issues/3371 | |
run: | | |
brew install python-setuptools | |
npm install github:SReject/electron-installer-dmg#9bdb5217b078c724918271549f34d362aecbf6bb | |
- name: Install Global Dependencies | |
run: npm install --global --production --omit=dev grunt-cli node-gyp | |
- name: Install Project Dependencies | |
run: npm install | |
- name: Decrypt Secrets.gpg | |
env: | |
PASSKEY_FOR_FIREBOT_SECRETS: ${{ secrets.PASSKEY_FOR_FIREBOT_SECRETS }} | |
run: grunt secrets:decrypt | |
- name: Set version of nightly | |
run: node ./nightly/scripts/set-version.js ${{ needs.getInfo.outputs.version }} | |
- name: Build for Platform | |
run: grunt build | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }} | |
path: ./dist/install/${{ runner.os == 'macOS' && 'darwin' || runner.os }}/ | |
draft: | |
name: Draft Github Release | |
needs: [getInfo, compile] | |
if: needs.getInfo.outputs.dobuild != 'false' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Compilation Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./bundles/ | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
token: ${{ env.GITHUB_TOKEN }} | |
draft: false | |
prerelease: false | |
tag_name: v${{ needs.getInfo.outputs.version }} | |
name: Nightly v${{ needs.getInfo.outputs.version }} | |
body: ${{ needs.getInfo.outputs.patchnotes }} | |
generate_release_notes: false | |
files: | | |
./bundles/Windows/firebot-v${{ needs.getInfo.outputs.version }}-setup.exe | |
./bundles/Linux/firebot-v${{ needs.getInfo.outputs.version }}-linux-x64.tar.gz | |
./bundles/Linux/firebot-v${{ needs.getInfo.outputs.version }}-linux-x64.deb | |
./bundles/Linux/firebot-v${{ needs.getInfo.outputs.version }}-linux-x64.rpm | |
./bundles/macOS/firebot-v${{ needs.getInfo.outputs.version }}-macos-x64.dmg | |
./bundles/macOS/firebot-v${{ needs.getInfo.outputs.version }}-macos-arm64.dmg |