Skip to content

Release

Release #80

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
draft_release:
required: true
type: boolean
description: Create a draft release
default: true
update_distribution:
required: true
type: boolean
description: Commit the release artifacts to the distribution directory
default: true
tag:
required: true
description: Release tag
type: string
release_desc:
required: false
type: string
description: Release Description
jobs:
updater:
name: Build Updater Tool
uses: misteraddons/Reflex-Adapt/.github/workflows/updater.yml@main
secrets: inherit
firmware:
name: Build Firmware
uses: misteraddons/Reflex-Adapt/.github/workflows/firmware.yml@main
assemble:
name: Create Release
runs-on: ubuntu-latest
needs: [ updater, firmware ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache-dependency-path: |
mister/go.sum
- name: Download Updater
uses: actions/download-artifact@v3
with:
path: updater
name: reflex_updater
- name: Download Firmware
uses: actions/download-artifact@v3
with:
name: firmware
path: firmware
- name: Build Release
run: |
RELEASE_DIR=distribution/${{ inputs.tag }}
rm -rf ${RELEASE_DIR}
mkdir -p ${RELEASE_DIR}/firmware
cp -v firmware/*.hex ${RELEASE_DIR}/firmware/
cp -v release_files/* ${RELEASE_DIR}/
cp -v updater/x86_64-pc-windows-msvc/reflex_updater.exe ${RELEASE_DIR}/reflex.exe
cp -v updater/x86_64-unknown-linux-musl/reflex_updater ${RELEASE_DIR}/reflex-linux-x86_64
cp -v updater/armv7-unknown-linux-musleabihf/reflex_updater ${RELEASE_DIR}/reflex-linux-armv7
cp -v updater/x86_64-apple-darwin/reflex_updater ${RELEASE_DIR}/reflex-macos
chmod +x ${RELEASE_DIR}/reflex-macos ${RELEASE_DIR}/reflex-linux-armv7 ${RELEASE_DIR}/reflex-linux-x86_64
ln -s ${RELEASE_DIR} reflex-${{ inputs.tag }}
- name: Zip Archive
run: zip -r reflex-${{ inputs.tag }}.zip reflex-${{ inputs.tag }}/
- name: Tar Archive
run: tar -czvhf reflex-${{ inputs.tag }}.tar.gz reflex-${{ inputs.tag }}/
- name: Build MiSTer Wrapper
run: |
RELEASE_DIR=distribution/${{ inputs.tag }}
cp -v ${RELEASE_DIR}/reflex-linux-armv7 mister/_files
cp -v ${RELEASE_DIR}/manifest.txt mister/_files
cp -rv ${RELEASE_DIR}/firmware mister/_files
cd mister
env GOARCH=arm GOARM=7 go build -ldflags="-s -w" -o _bin/reflex_updater.sh
cp -v _bin/reflex_updater.sh ../${RELEASE_DIR}/reflex_updater.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
reflex-${{ inputs.tag }}.tar.gz
reflex-${{ inputs.tag }}.zip
mister/_bin/reflex_updater.sh
tag_name: ${{ inputs.tag }}
body: ${{ inputs.release_desc }}
draft: ${{ inputs.draft_release }}
- name: Git Commit
uses: EndBug/add-and-commit@v9
if: ${{ inputs.update_distribution }}
with:
add: distribution/${{ inputs.tag }}/* -f -A