Skip to content

Commit

Permalink
Update build.yml (read notes)
Browse files Browse the repository at this point in the history
- Always run build on push to main/PR (NOTE: USE [skipci] ON NON-ESSENTIAL COMMIT TO MAIN)
- Delete short Git SHA generator (it no worky, need better solution)
- Notify status to Discord
  • Loading branch information
bagusnl authored Oct 13, 2023
1 parent 61c7cb5 commit ec86a09
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Credits to @Scighost from Starward for his contributions!
name: Build-Canary
run-name: Canary Build for ${{ github.ref }}
#run-name: Canary Build for ${{ github.ref }}

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # At 00:00 on Sunday
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# schedule:
# - cron: '0 0 * * 0' # At 00:00 on Sunday

jobs:
build:
Expand All @@ -28,12 +32,6 @@ jobs:
with:
submodules: recursive

- name: Get short Git SHA
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Cache dotnet # cache dotnet install https://stackoverflow.com/questions/75180149/how-to-cache-dotnet-installation-in-github-actions
id: cache-dotnet
uses: actions/cache@v3
Expand Down Expand Up @@ -78,3 +76,12 @@ jobs:
with:
name: collapse_${{ matrix.platform }}-${{ matrix.configuration }}_${{ matrix.framework }}_${{ github.sha }}
path: ./CollapseLauncher/preview-build/

- name: Notify discord
uses: th0th/[email protected]
if: ${{ always() }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_NIGHTLY }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_JOB_NAME: "Canary Build Status"
GITHUB_JOB_STATUS: ${{ job.status }}

0 comments on commit ec86a09

Please sign in to comment.