From b7d04bec65dec801a28b2c7536697e8c2a5a6872 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sun, 20 Oct 2024 14:18:00 -0700 Subject: [PATCH] Add source code bundle creation workflow --- .forgejo/workflows/compile.yaml | 42 ++++++++++++++++++++++++--------- setup-android-project.sh | 2 +- setup.sh | 2 +- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/compile.yaml b/.forgejo/workflows/compile.yaml index 3f1cea1..819d466 100644 --- a/.forgejo/workflows/compile.yaml +++ b/.forgejo/workflows/compile.yaml @@ -3,7 +3,7 @@ run-name: Build the project on: [push] jobs: - build-appimage: + get-source-code: runs-on: ubuntu-latest steps: - name: Check out repository code @@ -12,6 +12,28 @@ jobs: submodules: recursive ref: main fetch-depth: 0 + - name: Set up SDL android project + run: ./setup.sh && ./setup-android-project.sh + - name: Upload source code + uses: actions/upload-artifact@v3 + with: + name: source_archive + path: | + . + !**/.git + !.git + compression-level: 9 + overwrite: true + include-hidden-files: true + if-no-files-found: error + build-appimage: + runs-on: ubuntu-latest + steps: + - name: Download repository code + uses: actions/download-artifact@v3 + with: + name: source_archive + path: . - name: Install system dependencies run: apt update && apt install -y wget python3 python3-pip python3-venv - name: Install Python dependencies via pip @@ -33,12 +55,11 @@ jobs: build-android: runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v3 + - name: Download repository code + uses: actions/download-artifact@v3 with: - submodules: recursive - ref: main - fetch-depth: 0 + name: source_archive + path: . - name: Setup Java uses: fam-tech/setup-java@v3 with: @@ -71,12 +92,11 @@ jobs: build-windows: runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v3 + - name: Download repository code + uses: actions/download-artifact@v3 with: - submodules: recursive - ref: main - fetch-depth: 0 + name: source_archive + path: . - name: Build protoc run: ./build-protoc.sh - name: Install MinGW compiler diff --git a/setup-android-project.sh b/setup-android-project.sh index 6d81cac..70b5e56 100755 --- a/setup-android-project.sh +++ b/setup-android-project.sh @@ -1,4 +1,4 @@ -#!/bin/env -S NOT_SOURCED=1 /bin/sh +#!/bin/env -S NOT_SOURCED=1 /bin/bash if ! [ "$NOT_SOURCED" = "1" ]; then echo "Error: This script must not be sourced!" >&2 return 1 diff --git a/setup.sh b/setup.sh index 27cd5b3..e73b18f 100755 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,4 @@ #!/bin/bash -pushd "$(dirname "$0")subprojects/vgmstream" +pushd "$(dirname "$0")/subprojects/vgmstream" git apply ../../vgmstream.patch popd