From 9e186ba8d66d703b27e806e6ddc7de6dea2a31e4 Mon Sep 17 00:00:00 2001 From: Kharkunov Eugene Date: Mon, 8 Sep 2025 18:57:57 +0300 Subject: [PATCH] Add Bob's reusable workflow. Add dependabot configuration --- .github/dependabot.yml | 7 ++ .github/workflows/bob.yml | 155 ++++++++++++++++++++++++++++++++++++++ README.md | 4 +- 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/bob.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c833124 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/bob.yml b/.github/workflows/bob.yml new file mode 100644 index 0000000..5f44194 --- /dev/null +++ b/.github/workflows/bob.yml @@ -0,0 +1,155 @@ +name: Build with bob + +on: + workflow_call: + inputs: + ubuntu_runner: + required: false + type: string + description: 'Which Ubuntu runner should use' + default: ubuntu-latest + macos_runner: + required: false + type: string + description: 'Which MacOS runner should use' + default: 'macOSlatest' + windows_runner: + required: false + type: string + description: 'Which Windows runner should use' + default: windows-latest + build_server: + required: false + type: string + description: 'Buld server url' + default: 'https://build-stage.defold.com' + channel: + required: false + type: string + description: 'Which Defold version use to build. Possible values: alpha, beta, stable' + default: alpha + bob_version_filename: + required: false + type: string + description: 'JSON filename withi Bob versions' + default: 'info.json' + additonal_build_options: + required: false + type: string + description: 'Additional options passed to build command' + default: '--archive' + additonal_bundle_options: + required: false + type: string + description: 'Additional options passed to bundle command' + +jobs: + build_with_bob: + strategy: + matrix: + platform: [armv7-android, x86_64-linux, js-web] + runs-on: ${{ inputs.ubuntu_runner }} + + name: Build + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + with: + java-version: '21.0.5+11.0.LTS' + architecture: x64 + distribution: 'temurin' + + - name: Get Defold version + id: defold_version + run: | + TMPVAR=`curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1'` + echo "defold_version=${TMPVAR}" >> $GITHUB_OUTPUT + echo "Found version ${TMPVAR}" + + - name: Download bob.jar + run: | + wget -q http://d.defold.com/archive/${{ inputs.channel }}/${{ steps.defold_version.outputs.defold_version }}/bob/bob.jar + java -jar bob.jar --version + + - name: Installing Shared Library Dependencies + run: | + echo "Remove after we've fixed the headless build for plugins" + sudo apt-get update + sudo apt-get install -y libopenal-dev freeglut3-dev libgl-dev libglx-dev libegl-dev + + - name: Resolve libraries + run: java -jar bob.jar resolve + - name: Build + run: java -jar bob.jar --platform=${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }} + - name: Bundle + run: java -jar bob.jar --platform=${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }} + + build_with_bob_windows: + strategy: + matrix: + platform: [x86_64-win32, x86-win32] + runs-on: ${{ inputs.windows_runner }} + + name: Build + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + with: + java-version: '21.0.5+11.0.LTS' + architecture: x64 + distribution: 'temurin' + + - name: Get Defold version + id: defold_version + run: | + TMPVAR=`curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1'` + echo "defold_version=${TMPVAR}" >> $GITHUB_OUTPUT + echo "Found version ${TMPVAR}" + shell: bash + + - name: Download bob.jar + run: | + curl -s -o bob.jar http://d.defold.com/archive/${{ inputs.channel }}/${{ steps.defold_version.outputs.defold_version }}/bob/bob.jar + java -jar bob.jar --version + + - name: Resolve libraries + run: java -jar bob.jar resolve + - name: Build + run: java -jar bob.jar --platform=${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }} + - name: Bundle + run: java -jar bob.jar --platform=${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }} + + # macOS is not technically needed for building, but we want to test bundling as well, since we're also testing the manifest merging + build_with_bob_macos: + strategy: + matrix: + platform: [arm64-macos, x86_64-macos] + runs-on: macOS-latest + + name: Build + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + with: + java-version: '21.0.5+11.0.LTS' + architecture: x64 + distribution: 'temurin' + + - name: Get Defold version + id: defold_version + run: | + TMPVAR=`curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1'` + echo "defold_version=${TMPVAR}" >> $GITHUB_OUTPUT + echo "Found version ${TMPVAR}" + + - name: Download bob.jar + run: | + wget -q http://d.defold.com/archive/${{ inputs.channel }}/${{ steps.defold_version.outputs.defold_version }}/bob/bob.jar + java -jar bob.jar --version + + - name: Resolve libraries + run: java -jar bob.jar resolve + - name: Build + run: java -jar bob.jar --platform=${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }} + - name: Bundle + run: java -jar bob.jar --platform=${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }} \ No newline at end of file diff --git a/README.md b/README.md index fb3573a..84f28c9 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# github-actions-common \ No newline at end of file +# github-actions-common + +Repository contains set of reusable Github workflows which can be used in different repositories as utility stuff. \ No newline at end of file