Skip to content

modify build

modify build #69

Workflow file for this run

name: Build
permissions:
contents: write
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: Build tag
required: false
type: string
defaults:
run:
shell: bash
jobs:
bundle:
name: Bundle APWorld
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Compute build tag
id: tag
run: |
EVENT="${{ github.event_name }}"
TAG_INPUT="${{ inputs.tag }}"
REF="${{ github.ref_name }}"
SHA="$(git rev-parse --short=7 ${{ github.sha }})"
if [ "${EVENT}" = "workflow_dispatch" ]; then
echo "tag=${TAG_INPUT:-${SHA}}" >> $GITHUB_OUTPUT
elif [ "${EVENT}" = "push" ]; then
echo "tag=${REF}" >> $GITHUB_OUTPUT
else
echo "tag=${SHA}" >> $GITHUB_OUTPUT
fi
- name: Build bundle
run: TAG="${{ steps.tag.outputs.tag }}" PY_VERSION="${{ matrix.python-version}}" bash build/build.sh
- uses: actions/upload-artifact@v4
with:
name: metroidprime_apworld-${{ steps.tag.outputs.tag }}-${{ matrix.python-version }}
path: build/target/metroidprime_apworld-${{ steps.tag.outputs.tag }}.zip
- uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
name: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, '-rc') }}
draft: true
generate_release_notes: true
files: build/target/metroidprime_apworld-${{ steps.tag.outputs.tag }}-${{ matrix.python-version }}.zip