fixing release pipeline
This commit is contained in:
@@ -17,7 +17,6 @@ jobs:
|
|||||||
metadata:
|
metadata:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.release.outputs.matrix }}
|
|
||||||
version: ${{ steps.release.outputs.version }}
|
version: ${{ steps.release.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -42,10 +41,12 @@ jobs:
|
|||||||
done < <(git tag --list "${tag_prefix}*")
|
done < <(git tag --list "${tag_prefix}*")
|
||||||
patch=$((latest_patch + 1))
|
patch=$((latest_patch + 1))
|
||||||
version="${major}.${minor}.${patch}"
|
version="${major}.${minor}.${patch}"
|
||||||
matrix="$(jq -c '{include: .targets}' .gitea/release-targets.json)"
|
jq -e '
|
||||||
jq -e '.targets | length > 0' .gitea/release-targets.json >/dev/null
|
(.targets | length > 0) and
|
||||||
|
([.targets[].architecture] | length == (unique | length)) and
|
||||||
|
all(.targets[]; (.architecture | type == "string" and test("^[A-Za-z0-9_-]+$")))
|
||||||
|
' .gitea/release-targets.json >/dev/null
|
||||||
printf 'version=%s\n' "$version" >>"$GITHUB_OUTPUT"
|
printf 'version=%s\n' "$version" >>"$GITHUB_OUTPUT"
|
||||||
printf 'matrix=%s\n' "$matrix" >>"$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: metadata
|
needs: metadata
|
||||||
@@ -68,26 +69,23 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
needs: [metadata, create-release]
|
needs: [metadata, create-release]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix: ${{ fromJSON(needs.metadata.outputs.matrix) }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install SDK build dependencies
|
- name: Install SDK build dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install --yes build-essential clang flex bison g++ gawk gettext git libncurses-dev libssl-dev python3 rsync unzip zlib1g-dev file wget patch time curl jq zstd
|
sudo apt-get install --yes build-essential clang flex bison g++ gawk gettext git libncurses-dev libssl-dev python3 rsync unzip zlib1g-dev file wget patch time curl jq zstd
|
||||||
- name: Build ${{ matrix.architecture }} package
|
- name: Build and upload configured packages
|
||||||
env:
|
|
||||||
ARCHITECTURE: ${{ matrix.architecture }}
|
|
||||||
VERSION: ${{ needs.metadata.outputs.version }}
|
|
||||||
run: scripts/ci/build-release.sh .gitea/release-targets.json "$ARCHITECTURE" "$VERSION" dist
|
|
||||||
- name: Upload package to draft release
|
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
RELEASE_ID: ${{ needs.create-release.outputs.release-id }}
|
RELEASE_ID: ${{ needs.create-release.outputs.release-id }}
|
||||||
ASSET: dist/openUniFi-${{ matrix.architecture }}-${{ needs.metadata.outputs.version }}.apk
|
VERSION: ${{ needs.metadata.outputs.version }}
|
||||||
run: scripts/ci/gitea-release.sh upload
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
while IFS= read -r architecture; do
|
||||||
|
scripts/ci/build-release.sh .gitea/release-targets.json "$architecture" "$VERSION" dist
|
||||||
|
ASSET="dist/openUniFi-${architecture}-${VERSION}.apk" scripts/ci/gitea-release.sh upload
|
||||||
|
done < <(jq -r '.targets[].architecture' .gitea/release-targets.json)
|
||||||
|
|
||||||
publish-release:
|
publish-release:
|
||||||
needs: [metadata, create-release, build]
|
needs: [metadata, create-release, build]
|
||||||
|
|||||||
@@ -57,8 +57,9 @@ an incomplete set.
|
|||||||
|
|
||||||
Targets and the pinned OpenWrt release live in `.gitea/release-targets.json`.
|
Targets and the pinned OpenWrt release live in `.gitea/release-targets.json`.
|
||||||
Add an object with a unique `architecture` label and a valid OpenWrt
|
Add an object with a unique `architecture` label and a valid OpenWrt
|
||||||
`target`/`subtarget` pair to extend the matrix. The generic ARM entries select
|
`target`/`subtarget` pair to extend the build list; no workflow change is
|
||||||
ARMv7 and ARMv8 ABIs; use a device-specific OpenWrt target when necessary.
|
required. The generic ARM entries select ARMv7 and ARMv8 ABIs; use a
|
||||||
|
device-specific OpenWrt target when necessary.
|
||||||
|
|
||||||
Releases use the next available `MAJOR.MINOR.PATCH` tag. `MAJOR` and `MINOR`
|
Releases use the next available `MAJOR.MINOR.PATCH` tag. `MAJOR` and `MINOR`
|
||||||
live in the release config; the workflow finds the highest existing
|
live in the release config; the workflow finds the highest existing
|
||||||
|
|||||||
Reference in New Issue
Block a user