Skip to content

✨ Account freezing and CLI tool #185

✨ Account freezing and CLI tool

✨ Account freezing and CLI tool #185

Workflow file for this run

name: 'Stump Nightly CI'
on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
# TODO: should I push nightly on main pushes? then on tag, an actual tagged release?
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
jobs:
docker-build:
name: Build docker image
runs-on: [self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v3
# FIXME: vars.SUPPORTED_PR_DOCKER_PLATFORMS and vars.SUPPORTED_DOCKER_PLATFORMS
# suddenly doesn't work anymore??? super annoying...
# On PRs, we will only load the image into docker for the quickest platform
# (i.e. linux/amd64). This is mostly a smoke test, just rather ignorant verification
# that the image can be built. On pushes, we will actually build and push for
# all supported platforms.
- name: Configure environment
run: |
echo "LOAD=${{ github.event_name == 'pull_request' }}" >> $GITHUB_ENV
echo "PUSH=${{ github.event_name == 'push' }}" >> $GITHUB_ENV
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV
else
echo "PLATFORMS=linux/arm64/v8,linux/amd64" >> $GITHUB_ENV
fi
- name: Setup and build docker image
uses: ./.github/actions/build-docker
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
tags: 'nightly'
load: ${{ env.LOAD }}
push: ${{ env.PUSH }}
platforms: ${{ env.PLATFORMS }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
# TODO: build executables for apple(x86_64,darwin?),linux(x86_64,arm64?), and windows(x86_64)
# These should be uploaded to the nightly release as artifacts. Old artifacts should be deleted
# before uploading new ones.
build-web:
name: Bundle web app
runs-on: [self-hosted]
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build web
uses: ./.github/actions/build-web
- name: Upload web build
uses: ./.github/actions/upload-artifact
with:
upload-name: webapp
upload-path: apps/web/dist
build-linux-server:
name: Compile server app (self-hosted linux)
needs: build-web
runs-on: [self-hosted]
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build server
uses: ./.github/actions/build-server
with:
platform: 'linux'
- name: Upload stump server
uses: ./.github/actions/upload-artifact
with:
upload-name: stump_server-linux
upload-path: target/release/stump_server
build-server:
strategy:
fail-fast: true
matrix:
platform: [macos, windows]
name: Compile server app
needs: build-web
runs-on: ${{ matrix.platform }}
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build server
uses: ./.github/actions/build-server
with:
platform: ${{ matrix.platform }}
- name: Upload stump server
uses: ./.github/actions/upload-artifact
with:
upload-name: stump_server-${{ matrix.platform }}
upload-path: target/release/stump_server
# build-linux-desktop:
# name: Compile desktop app (self-hosted linux)
# needs: build-web
# runs-on: [self-hosted]
# if: false # TODO: don't do that
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Build desktop
# uses: ./.github/actions/build-desktop
# with:
# platform: 'linux'
# - name: Upload desktop
# uses: ./.github/actions/upload-artifact
# with:
# upload-name: stump-desktop-linux
# upload-path: target/release/bundle
build-desktop:
strategy:
fail-fast: true
matrix:
platform: [macos, windows]
name: Compile desktop app
needs: build-web
runs-on: ${{ matrix.platform }}
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build desktop
uses: ./.github/actions/build-desktop
with:
platform: ${{ matrix.platform }}
# https://github.com/tauri-apps/tauri-action
# - uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tagName: stump-desktop-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
# releaseName: 'Stump Desktop v__VERSION__'
# releaseBody: 'See the assets to download this version and install.'
# releaseDraft: true
# prerelease: true
# - name: Upload desktop
# uses: ./.github/actions/upload-artifact
# with:
# upload-name: stump-desktop-${{ matrix.platform }}
# upload-path: target/release/bundle