Release Version #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Version | |
on: workflow_dispatch | |
jobs: | |
build_script: | |
name: Build single-file Script | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: 'tiki_build' | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'premake/premake-core' | |
path: 'premake' | |
- name: Build Premake | |
run: | | |
cd premake | |
make -f Bootstrap.mak linux | |
cp bin/release/premake5 ../tiki_build/ | |
cd .. | |
- name: Generate script | |
run: | | |
cd tiki_build | |
./premake5 generate | |
echo "Script generation successful for build $build_id" | |
cd .. | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: script | |
path: tiki_build/tiki_build.lua | |
build_executable: | |
name: Build Executables | |
needs: build_script | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- os: ubuntu-latest | |
- os: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: 'tiki_build' | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'premake/premake-core' | |
path: 'premake' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: script | |
path: premake | |
- name: Patch Premake | |
run: | | |
cd premake | |
git apply ../tiki_build/premake5_tiki_build.patch | |
cd .. | |
- name: Build Premake Linux | |
if: matrix.config.os != 'windows-latest' | |
run: | | |
cd premake | |
make -f Bootstrap.mak linux | |
cd .. | |
echo "output_name=exe_linux" >> $GITHUB_ENV | |
echo "output_path=premake/bin/release/premake_tb" >> $GITHUB_ENV | |
- name: Build Premake Windows | |
if: matrix.config.os == 'windows-latest' | |
run: | | |
cd premake | |
.\Bootstrap.bat | |
cd .. | |
echo "output_name=exe_windows" >> $env:GITHUB_ENV | |
echo "output_path=premake/bin/release/premake_tb.exe" >> $env:GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.output_name }} | |
path: ${{ env.output_path }} | |
create_release: | |
name: Create release | |
needs: build_executable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: 'tiki_build' | |
- name: Write release info | |
run: | | |
cd tiki_build | |
build_id=$(git rev-list --count HEAD) | |
build_message=$(git log --format=%B -n 1 ${{ github.sha }}) | |
echo "build_id=$build_id" >> $GITHUB_ENV | |
cd .. | |
echo "System Script and Executable release of ${{ github.sha }}" >> release_body.txt | |
echo "" >> release_body.txt | |
echo "Changes:" >> release_body.txt | |
echo "$build_message" >> release_body.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: script | |
- uses: actions/download-artifact@v3 | |
with: | |
name: exe_linux | |
- uses: actions/download-artifact@v3 | |
with: | |
name: exe_windows | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.build_id }} | |
release_name: Release ${{ env.build_id }} | |
body_path: release_body.txt | |
- name: Upload Script | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./tiki_build.lua | |
asset_name: tiki_build.lua | |
asset_content_type: application/x-lua | |
- name: Upload Executable Linux | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./premake_tb | |
asset_name: premake_tb | |
asset_content_type: application/octet-stream | |
- name: Upload Executable Windows | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./premake_tb.exe | |
asset_name: premake_tb.exe | |
asset_content_type: application/octet-stream |