Merge pull request #1515 from apernet/feat/improve-workflows
feat: improve workflows
This commit is contained in:
commit
5f1133feac
4 changed files with 99 additions and 99 deletions
78
.github/workflows/build-common.yml
vendored
Normal file
78
.github/workflows/build-common.yml
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
name: "Build common"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
outputs:
|
||||
files: ${{ steps.list-files.outputs.files }}
|
||||
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Setup Python # This is for the build script
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r29
|
||||
add-to-path: false
|
||||
|
||||
- name: Run build script
|
||||
env:
|
||||
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
run: |
|
||||
export HY_APP_PLATFORMS=$(sed 's/\r$//' platforms.txt | awk '!/^#/ && !/^$/' | paste -sd ",")
|
||||
python hyperbole.py build -r
|
||||
|
||||
- name: Generate hashes
|
||||
run: |
|
||||
for file in build/*; do
|
||||
sha256sum $file >> build/hashes.txt
|
||||
done
|
||||
|
||||
- name: List build files
|
||||
id: list-files
|
||||
run: |
|
||||
files=$(ls -1 build/ | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
echo "files=$files" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload build directory
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-temp-${{ github.sha }}
|
||||
path: build/
|
||||
|
||||
upload:
|
||||
name: Upload ${{ matrix.file }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
file: ${{ fromJson(needs.build.outputs.files) }}
|
||||
steps:
|
||||
- name: Download build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-temp-${{ github.sha }}
|
||||
|
||||
- name: Upload ${{ matrix.file }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.file }}
|
||||
path: ${{ matrix.file }}
|
||||
10
.github/workflows/experimental.yml
vendored
Normal file
10
.github/workflows/experimental.yml
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
name: "Build experimental branches"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- exp/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/build-common.yml
|
||||
73
.github/workflows/master.yml
vendored
73
.github/workflows/master.yml
vendored
|
|
@ -7,75 +7,4 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
outputs:
|
||||
files: ${{ steps.list-files.outputs.files }}
|
||||
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Setup Python # This is for the build script
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r29
|
||||
add-to-path: false
|
||||
|
||||
- name: Run build script
|
||||
env:
|
||||
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
run: |
|
||||
export HY_APP_PLATFORMS=$(sed 's/\r$//' platforms.txt | awk '!/^#/ && !/^$/' | paste -sd ",")
|
||||
python hyperbole.py build -r
|
||||
|
||||
- name: Generate hashes
|
||||
run: |
|
||||
for file in build/*; do
|
||||
sha256sum $file >> build/hashes.txt
|
||||
done
|
||||
|
||||
- name: List build files
|
||||
id: list-files
|
||||
run: |
|
||||
files=$(ls -1 build/ | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
echo "files=$files" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload build directory
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-temp-${{ github.sha }}
|
||||
path: build/
|
||||
retention-days: 1
|
||||
|
||||
upload:
|
||||
name: Upload ${{ matrix.file }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
file: ${{ fromJson(needs.build.outputs.files) }}
|
||||
steps:
|
||||
- name: Download build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-temp-${{ github.sha }}
|
||||
|
||||
- name: Upload ${{ matrix.file }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.file }}
|
||||
path: ${{ matrix.file }}
|
||||
uses: ./.github/workflows/build-common.yml
|
||||
|
|
|
|||
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
|
|
@ -7,11 +7,12 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
uses: ./.github/workflows/build-common.yml
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -20,34 +21,16 @@ jobs:
|
|||
id: get_version
|
||||
run: echo "version=$(git describe --tags --always --match 'app/v*' | sed -n 's|app/\([^/-]*\)\(-.*\)\{0,1\}|\1|p')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Setup Python # This is for the build script
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
- name: Download build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
ndk-version: r29
|
||||
add-to-path: false
|
||||
|
||||
- name: Run build script
|
||||
env:
|
||||
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
run: |
|
||||
export HY_APP_PLATFORMS=$(sed 's/\r$//' platforms.txt | awk '!/^#/ && !/^$/' | paste -sd ",")
|
||||
python hyperbole.py build -r
|
||||
|
||||
- name: Generate hashes
|
||||
run: |
|
||||
for file in build/*; do
|
||||
sha256sum $file >> build/hashes.txt
|
||||
done
|
||||
name: build-temp-${{ github.sha }}
|
||||
path: build
|
||||
|
||||
- name: Upload GitHub
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue