Skip to content

treewide: update project to BlocksDS v0.12.0 #30

treewide: update project to BlocksDS v0.12.0

treewide: update project to BlocksDS v0.12.0 #30

Workflow file for this run

name: Build nightly
on:
push:
branches: ["main"]
paths-ignore:
- 'README.md'
pull_request:
branches: ["main"]
paths-ignore:
- 'README.md'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: skylyrac/blocksds:slim-latest
name: Build with Docker using BlocksDS
outputs:
commit_hash: ${{ steps.vars.outputs.commit_hash }}
author_name: ${{ steps.vars.outputs.author_name }}
committer_name: ${{ steps.vars.outputs.committer_name }}
commit_subject: ${{ steps.vars.outputs.commit_subject }}
commit_message: ${{ steps.vars.outputs.commit_message }}
current_date: ${{ steps.vars.outputs.current_date }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup environment
run: git config --global safe.directory '*'
- name: Make application
id: build
run: |
make VERBOSE=1
- name: Set variables
id: vars
run: |
echo "commit_hash=$(git log --format=%h -1)" >> $GITHUB_OUTPUT
# Webhook info
echo "author_name=$(git log -1 $GITHUB_SHA --pretty=%aN)" >> $GITHUB_OUTPUT
echo "committer_name=$(git log -1 $GITHUB_SHA --pretty=%cN)" >> $GITHUB_OUTPUT
echo "commit_subject=$(git log -1 $GITHUB_SHA --pretty=%s)" >> $GITHUB_OUTPUT
echo "commit_message=$(git log -1 $GITHUB_SHA --pretty=%b)" >> $GITHUB_OUTPUT
CURRENT_DATE=$(date +"%Y%m%d-%H%M%S")
echo "current_date=$CURRENT_DATE" >> $GITHUB_OUTPUT
- name: Publish build to GH Actions
uses: actions/upload-artifact@v2
with:
path: dsbf_dump.nds
name: dsbf_dump-nightly
send_webhook:
runs-on: ubuntu-latest
needs: [build]
name: Send Discord webhook
if: ${{ !startsWith(github.ref, 'refs/pull') }}
env:
CURRENT_DATE: ${{ needs.build.outputs.current_date }}
AUTHOR_NAME: ${{ needs.build.outputs.author_name }}
COMMITTER_NAME: ${{ needs.build.outputs.committer_name }}
COMMIT_SUBJECT: ${{ needs.build.outputs.commit_subject }}
COMMIT_MESSAGE: ${{ needs.build.outputs.commit_message }}
steps:
- name: Send success webhook
if: ${{ success() }}
run: |
curl -o send.sh https://raw.githubusercontent.com/DS-Homebrew/discord-webhooks/master/send-ghactions.sh
chmod +x send.sh
./send.sh success ${{ secrets.WEBHOOK_URL }}
- name: Send failure webhook
if: ${{ failure() }}
run: |
curl -o send.sh https://raw.githubusercontent.com/DS-Homebrew/discord-webhooks/master/send-ghactions.sh
chmod +x send.sh
./send.sh failure ${{ secrets.WEBHOOK_URL }}