Add publish to pipeline.

Update deployment docs.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-05-10 04:29:08 +00:00
parent c68d5c075f
commit df55b42d29
12 changed files with 234 additions and 105 deletions

View File

@@ -72,7 +72,10 @@ jobs:
machine: ${{fromJSON(inputs.machines)}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Bake
env:
bake_target: ${{matrix.bake_target}}

View File

@@ -51,10 +51,14 @@ on:
type: boolean
default: true
description: Pre-build cargo dependency targets
show_docs:
type: boolean
default: true
description: Pre-build cargo rustdoc targets
jobs:
systems:
if: inputs.show_systems
if: ${{ !failure() && !cancelled() && inputs.show_systems }}
name: System
uses: ./.github/workflows/bake.yml
with:
@@ -71,7 +75,7 @@ jobs:
includes: ${{inputs.includes}}
buildsys:
if: inputs.show_systems
if: ${{ !failure() && !cancelled() && inputs.show_systems }}
name: Builder
needs: [systems]
uses: ./.github/workflows/bake.yml
@@ -89,7 +93,7 @@ jobs:
includes: ${{inputs.includes}}
sources:
if: inputs.show_sources
if: ${{ !failure() && !cancelled() && inputs.show_sources }}
name: Acquire
needs: [buildsys]
uses: ./.github/workflows/bake.yml
@@ -107,7 +111,7 @@ jobs:
includes: ${{inputs.includes}}
rocksdb:
if: inputs.show_rocksdb
if: ${{ !failure() && !cancelled() && inputs.show_rocksdb }}
name: RocksDB
needs: [sources]
uses: ./.github/workflows/bake.yml
@@ -125,7 +129,7 @@ jobs:
includes: ${{inputs.includes}}
deps:
if: inputs.show_cargo
if: ${{ !failure() && !cancelled() && inputs.show_cargo }}
name: Build
needs: [rocksdb]
uses: ./.github/workflows/bake.yml
@@ -141,3 +145,21 @@ jobs:
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
docs:
if: ${{ !failure() && !cancelled() && inputs.show_docs }}
name: Docs
needs: [deps]
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["docs"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}

View File

@@ -91,7 +91,6 @@ jobs:
clippy:
if: ${{ !failure() && !cancelled() }}
name: Clippy
needs: [fmt, audit, lychee]
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["clippy"]'
@@ -105,21 +104,3 @@ jobs:
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
doc:
if: ${{ !failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) }}
name: Docs
needs: [clippy]
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["docs"]'
cargo_profiles: '["test"]'
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}

View File

@@ -60,12 +60,12 @@ jobs:
sys_targets: ${{vars.sys_TARGETS}}
sys_versions: ${{vars.SYS_VERSIONS}}
machines: ${{vars.MACHINES}}
complement: true
complement: ${{fromJSON(vars.COMPLEMENT || 'true')}}
package:
if: ${{ !failure() && !cancelled() }}
name: Package
needs: [test]
needs: [lint]
uses: ./.github/workflows/package.yml
with:
cargo_profiles: '["release"]'
@@ -80,7 +80,7 @@ jobs:
publish:
if: ${{ !failure() && !cancelled() }}
name: Publish
needs: [package]
needs: [test, package]
uses: ./.github/workflows/publish.yml
with:
cargo_profiles: '["release"]'
@@ -91,3 +91,6 @@ jobs:
rust_targets: ${{vars.RUST_TARGETS}}
sys_targets: ${{vars.sys_TARGETS}}
machines: ${{vars.MACHINES}}
secrets:
dockerhub_token: ${{ secrets.dockerhub_token }}
ghcr_token: ${{ secrets.ghcr_token }}

View File

@@ -43,7 +43,7 @@ jobs:
name: Deb
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["pkg-deb-install"]'
bake_targets: '["pkg-deb"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: '["all"]'
rust_toolchains: ${{inputs.rust_toolchains}}
@@ -71,3 +71,20 @@ jobs:
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
static:
if: ${{ !failure() && !cancelled() && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) }}
name: Standalone
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["standalone"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: '["all"]'
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}

View File

@@ -36,38 +36,98 @@ on:
type: string
default: '[]'
description: Matrix inclusions
secrets:
dockerhub_token:
ghcr_token:
jobs:
dockerhub:
if: ${{ !failure() && !cancelled() && github.ref == 'refs/heads/main' }}
name: DockerHub
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["dockerhub"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
containers:
if: ${{ !failure() && !cancelled() }}
name: Publish via Github
runs-on: ${{matrix.machine}}
permissions: write-all
strategy:
fail-fast: false
matrix:
bake_target: ${{fromJSON('["github", "dockerhub"]')}}
cargo_profile: ${{fromJSON(inputs.cargo_profiles)}}
rust_toolchain: ${{fromJSON(inputs.rust_toolchains)}}
feat_set: ${{fromJSON(inputs.feat_sets)}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON(inputs.sys_targets)}}
machine: ${{fromJSON(inputs.machines)}}
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
ghcr:
if: ${{ !failure() && !cancelled() && github.ref == 'refs/heads/main' }}
name: GitHub Container Registry
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["github"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
steps:
- name: GitHub Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ghcr_token }}
- uses: actions/checkout@v4
- name: DockerHub Login
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ github.actor }}
password: ${{ secrets.dockerhub_token }}
- name: Bake
env:
bake_target: ${{matrix.bake_target}}
cargo_profile: ${{matrix.cargo_profile}}
rust_toolchain: ${{matrix.rust_toolchain}}
rust_target: ${{matrix.rust_target}}
feat_set: ${{matrix.feat_set}}
sys_name: ${{matrix.sys_name}}
sys_version: ${{matrix.sys_version}}
sys_target: ${{matrix.sys_target}}
machine: ${{matrix.machine}}
acct: ${{github.actor}}
repo: ${{github.repository}}
CI_VERBOSE_ENV: ${{inputs.verbose_env}}
CI_SILENT_BAKE: ${{inputs.silent_bake}}
CI_PRINT_BAKE: ${{inputs.print_bake}}
run: |
docker/bake.sh ${{matrix.bake_target}}
packages:
if: ${{ !failure() && !cancelled() && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) }}
name: Publish packages
runs-on: ${{matrix.machine}}
strategy:
fail-fast: false
matrix:
target: ${{fromJSON('[["pkg-rpm","tuwunel-1.0.0-1.x86_64.rpm"],["pkg-deb","tuwunel_1.0.0-1_amd64.deb"],["standalone", "tuwunel"]]')}}
cargo_profile: ${{fromJSON(inputs.cargo_profiles)}}
rust_toolchain: ${{fromJSON(inputs.rust_toolchains)}}
feat_set: ${{fromJSON('["all"]')}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON(inputs.sys_targets)}}
machine: ${{fromJSON(inputs.machines)}}
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
steps:
- name: Extract
env:
iid: ${{matrix.target[0]}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
file: ${{matrix.target[1]}}
run: |
cid=$(docker create "$iid" /)
docker cp "$cid:$file" .
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.target[1]}}
path: ${{matrix.target[1]}}

View File

@@ -94,7 +94,6 @@ jobs:
if: ${{inputs.complement && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])}}
name: Complement Testee
uses: ./.github/workflows/bake.yml
needs: [smoke]
with:
bake_targets: '["complement-testee"]'
cargo_profiles: '["test"]'
@@ -132,7 +131,9 @@ jobs:
include: ${{fromJSON(inputs.includes)}}
steps:
- name: Complement
- uses: actions/checkout@v3
- name: Execute
id: execute
env:
cargo_profile: ${{matrix.cargo_profile}}
rust_toolchain: ${{matrix.rust_toolchain}}
@@ -145,3 +146,21 @@ jobs:
run: |
docker/complement.sh
- name: Results
id: extract
env:
name: complement_tester__${{matrix.cargo_profile}}__${{matrix.rust_toolchain}}__${{matrix.rust_target}}__${{matrix.feat_set}}__${{matrix.sys_name}}__${{matrix.sys_version}}__${{matrix.sys_target}}
tag: latest
run: |
cid=$(cat "$name")
docker cp "$cid:/usr/src/complement/new_results.jsonl" tests/test_results/complement/test_results.jsonl
git diff --exit-code --color --color-moved
- name: Artifacts
id: upload
uses: actions/upload-artifact@v4
with:
name: test_results.${{matrix.feat_set}}.${{matrix.sys_name}}.${{matrix.sys_target}}.jsonl
path: ./tests/test_results/complement/test_results.jsonl