Skip to content

change default patches #23

change default patches

change default patches #23

Workflow file for this run

name: Build, zip, Bootloader
on:
push:
tags:
- hbng_bl_nightly
- hbng_bl_v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get current datetime
id: get-datetime
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Set templates for nightly
id: set-templates-nightly
if: startsWith(github.ref, 'refs/tags/hbng_bl_nightly')
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}_${{ env.CURRENT_DATE }}_${{ github.run_number }}" >> $GITHUB_ENV
echo "RELEASE_NAME=Nightly ${{ env.CURRENT_DATE }} - Run ID ${{ github.run_number }}" >> $GITHUB_ENV
echo "ASSET_APPENDIX=nightly_${{ env.CURRENT_DATE }}.${{ github.run_number }}" >> $GITHUB_ENV
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
- name: Set templates for release and delete trigger tag
id: set-templates-release
if: startsWith(github.ref, 'refs/tags/hbng_bl_v')
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "RELEASE_NAME=Release ${GITHUB_REF#refs/tags/hbng_bl_}" >> $GITHUB_ENV
echo "ASSET_APPENDIX=release_${GITHUB_REF#refs/tags/hbng_bl_}" >> $GITHUB_ENV
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Build and zip Bootloader
id: build-zip-bootloader
run: ./common/buildAndShip.bootloader.sh
- name: Build and zip Bootloader Debug
id: build-zip-bootloader-debug
run: ./common/buildAndShip.bootloader.sh debug
- name: Check release zip existence
id: check_release
uses: andstor/file-existence-action@v1
with:
files: "./exe/sd-bootloader-ng.zip, ./exe/sd-bootloader-ng_debug.zip"
allow_failure: true
- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
run: echo All files exists!
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: HackieboxNG Bootloader ${{ env.RELEASE_NAME }}
draft: true
prerelease: ${{ env.IS_PRERELEASE }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./exe/sd-bootloader-ng.zip
asset_name: hbng-bootloader.${{ env.ASSET_APPENDIX }}.zip
asset_content_type: application/zip
- name: Upload Debug Asset
id: upload-debug-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./exe/sd-bootloader-ng_debug.zip
asset_name: hbng-bootloader_debug.${{ env.ASSET_APPENDIX }}.zip
asset_content_type: application/zip