chore: bump plugin versions to 0.1.2 and refactor CI workflow to use sequential plugin processing
Release / check-release (push) Successful in 18s
Release / build (push) Skipped
Release / package (deb) (push) Skipped
Release / package (rpm) (push) Skipped
Release / publish (push) Skipped
CI / test (push) Successful in 1m38s
Plugin Releases / build-package-publish (push) Failing after 4m59s
Release / check-release (push) Successful in 18s
Release / build (push) Skipped
Release / package (deb) (push) Skipped
Release / package (rpm) (push) Skipped
Release / publish (push) Skipped
CI / test (push) Successful in 1m38s
Plugin Releases / build-package-publish (push) Failing after 4m59s
This commit is contained in:
@@ -10,36 +10,7 @@ env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
detect:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.plugins.outputs.matrix }}
|
||||
count: ${{ steps.plugins.outputs.count }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install discovery tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y jq
|
||||
- name: Discover changed plugins
|
||||
id: plugins
|
||||
env:
|
||||
BEFORE: ${{ gitea.event.before }}
|
||||
AFTER: ${{ gitea.sha }}
|
||||
run: |
|
||||
matrix=$(packaging/changed-plugins.sh "$BEFORE" "$AFTER")
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
echo "count=$(jq '.["include"] | length' <<<"$matrix")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build-package-publish:
|
||||
needs: detect
|
||||
if: needs.detect.outputs.count != '0'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.detect.outputs.matrix) }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -51,35 +22,72 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-unknown-linux-gnu
|
||||
- name: Install discovery tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y jq
|
||||
- name: Discover changed plugins
|
||||
id: plugins
|
||||
env:
|
||||
BEFORE: ${{ gitea.event.before }}
|
||||
AFTER: ${{ gitea.sha }}
|
||||
run: |
|
||||
packaging/changed-plugins.sh "$BEFORE" "$AFTER" > .plugin-release-plan.json
|
||||
jq . .plugin-release-plan.json
|
||||
echo "count=$(jq '.["include"] | length' .plugin-release-plan.json)" >> "$GITHUB_OUTPUT"
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
- name: Test plugin
|
||||
env:
|
||||
CONVERTIS_ENGINE_VERSION: ${{ matrix.engine_version }}
|
||||
run: cargo test --locked --manifest-path "${{ matrix.manifest }}"
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
run: |
|
||||
while IFS= read -r plugin; do
|
||||
manifest=$(jq -r '.manifest' <<<"$plugin")
|
||||
engine_version=$(jq -r '.engine_version' <<<"$plugin")
|
||||
echo "Testing $manifest for engine $engine_version"
|
||||
CONVERTIS_ENGINE_VERSION="$engine_version" \
|
||||
cargo test --locked --manifest-path "$manifest"
|
||||
done < <(jq -c '.["include"][]' .plugin-release-plan.json)
|
||||
- name: Build plugin
|
||||
env:
|
||||
CONVERTIS_ENGINE_VERSION: ${{ matrix.engine_version }}
|
||||
run: cargo build --release --locked --manifest-path "${{ matrix.manifest }}" --target x86_64-unknown-linux-gnu
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
run: |
|
||||
mkdir -p plugin-artifacts
|
||||
while IFS= read -r plugin; do
|
||||
manifest=$(jq -r '.manifest' <<<"$plugin")
|
||||
engine_version=$(jq -r '.engine_version' <<<"$plugin")
|
||||
library=$(jq -r '.library' <<<"$plugin")
|
||||
echo "Building $manifest for engine $engine_version"
|
||||
CONVERTIS_ENGINE_VERSION="$engine_version" \
|
||||
cargo build --release --locked --manifest-path "$manifest" --target x86_64-unknown-linux-gnu
|
||||
cp "target/x86_64-unknown-linux-gnu/release/$library" plugin-artifacts/
|
||||
done < <(jq -c '.["include"][]' .plugin-release-plan.json)
|
||||
- uses: actions/setup-go@v5
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
with:
|
||||
go-version: stable
|
||||
- name: Install packaging tools
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
run: |
|
||||
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.47.0
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y rpm
|
||||
- name: Build plugin packages
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
run: |
|
||||
export PATH="$HOME/go/bin:$PATH"
|
||||
packaging/build-plugin-package.sh deb "${{ matrix.manifest }}" target/x86_64-unknown-linux-gnu/release dist
|
||||
packaging/build-plugin-package.sh rpm "${{ matrix.manifest }}" target/x86_64-unknown-linux-gnu/release dist
|
||||
while IFS= read -r plugin; do
|
||||
manifest=$(jq -r '.manifest' <<<"$plugin")
|
||||
packaging/build-plugin-package.sh deb "$manifest" target/x86_64-unknown-linux-gnu/release dist
|
||||
packaging/build-plugin-package.sh rpm "$manifest" target/x86_64-unknown-linux-gnu/release dist
|
||||
done < <(jq -c '.["include"][]' .plugin-release-plan.json)
|
||||
- name: Import GPG key
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
id: import-gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- name: Sign and verify RPM
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
env:
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
run: |
|
||||
@@ -98,13 +106,15 @@ jobs:
|
||||
sudo rpm --import "$public_key_file"
|
||||
rpm --checksig --verbose dist/*.rpm | grep -Eq '[Ss]ignature.*: OK'
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
with:
|
||||
name: ${{ matrix.package }}-${{ matrix.version }}
|
||||
name: plugin-packages
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
target/x86_64-unknown-linux-gnu/release/${{ matrix.library }}
|
||||
plugin-artifacts/*
|
||||
dist/*
|
||||
- name: Publish plugin packages to Gitea
|
||||
if: steps.plugins.outputs.count != '0'
|
||||
env:
|
||||
GITEA_URL: ${{ gitea.server_url }}
|
||||
GITEA_OWNER: ${{ gitea.repository_owner }}
|
||||
|
||||
Reference in New Issue
Block a user