Skip to content

Commit

Permalink
Update build script to be more automatic in generating full releases. (
Browse files Browse the repository at this point in the history
  • Loading branch information
PhlexPlexico authored Feb 11, 2024
1 parent 4b79816 commit c7a534e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/create-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Last Nightly Commit and Private Key
id: nightly-version
run: |
echo "last_nightly=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
if [[ ${{ github.event.inputs.build_type == 'Nightly' }} == true ]]; then
echo "last_nightly=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
else
echo "last_nightly=$(git describe --tags --match="v[0-9]*" HEAD)" >> $GITHUB_ENV
fi
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4.0.1
uses: metcalfc/changelog-generator@v4.3.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
base-ref: ${{ env.last_nightly }}
Expand All @@ -46,12 +51,15 @@ jobs:

steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Run Build Script
run: |
if [[ ${{ github.event.inputs.build_type == 'Release' }} == true ]]; then
url_tag=v${{ github.event.inputs.version }}
fi
chmod +x linux_build_rando.sh
./linux_build_rando.sh
Expand All @@ -61,7 +69,7 @@ jobs:

- if: ${{ github.event.inputs.build_type == 'Nightly' }}
name: Create Pre-release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "MM3D_Randomizer.cia,MM3D_Randomizer.3dsx,cia.png,3dsx.png"
Expand All @@ -84,7 +92,7 @@ jobs:
- if: ${{ github.event.inputs.build_type == 'Release' }}
name: Create Release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "MM3D_Randomizer.cia,MM3D_Randomizer.3dsx,cia.png,3dsx.png"
Expand All @@ -93,15 +101,15 @@ jobs:
tag: "v${{ github.event.inputs.version }}"
name: "v${{ github.event.inputs.version }}"
body: |
${{ github.event.inputs.version }} Changes:
- Please check back later for a full list of changes.
${{ github.event.inputs.version }} Changes 🛠:
${{ needs.get-changelog.outputs.changelog }}
When reporting issues, please mention the six character commit listed in the randomizer menu.
You can use the FBI homebrew application to install the randomizer using either of these QR codes.
CIA QR Code:
![CIA Download](https://github.com/${{ github.repository }}/releases/download/Nightly-${{ env.sha_short }}/cia.png)
![CIA Download](https://github.com/${{ github.repository }}/releases/download/v${{ github.event.inputs.version }}/cia.png)
3DSX QR Code:
![CIA Download](https://github.com/${{ github.repository }}/releases/download/Nightly-${{ env.sha_short }}/3dsx.png)
![CIA Download](https://github.com/${{ github.repository }}/releases/download/v${{ github.event.inputs.version }}/3dsx.png)
deploy-gist:
needs: build-cia-3dsx
Expand Down
13 changes: 9 additions & 4 deletions linux_build_rando.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ compile() {
APP_NAME=$(basename "$PWD")
BANNERTOOLAPP=bannertool
IS_GH_ACTIONS=true
if [ -n "$var" ]; then
echo "Building on Github Actions.."
if [ -n "$GITHUB_SHA" ]; then
echo "Building on Github Actions..."
else
echo "GITHUB_SHA is empty, building locally."
IS_GH_ACTIONS=false
Expand Down Expand Up @@ -43,8 +43,13 @@ compile() {
3dstool -cvtf romfs ./romfs.bin --romfs-dir ./romfs
makerom -f cia -o ${APP_NAME}.cia -DAPP_ENCRYPTED=false -target t -exefslogo -elf ./${APP_NAME}.elf -icon ./icon.icn -banner ./banner.bnr -rsf ./mmrando.rsf -romfs ./romfs.bin -major 1 -minor 0 -micro 0
if $IS_GH_ACTIONS; then
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.3dsx
if [ -n "$url_tag" ]; then
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/$url_tag/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/$url_tag/${APP_NAME}.3dsx
else
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.3dsx
fi
fi
}

Expand Down

0 comments on commit c7a534e

Please sign in to comment.