Skip to content
Merged

Dev #151

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/linux-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build Linux release

on:
workflow_call:
inputs:
version:
description: 'Release version (git tag), e.g. 1.18.4'
type: string
required: false
ref:
description: 'Git ref to check out and build'
type: string
required: false
draft_tag:
description: 'Draft GitHub release tag to attach the assets to (e.g. untagged-xxxx). Empty = skip upload.'
type: string
required: false
secrets:
GH_TOKEN:
required: false

workflow_dispatch:
inputs:
ref:
description: 'Git ref to check out and build'
type: string
required: false

jobs:
build-linux:
name: Build linux/${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-musl
- arch: arm64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}

- name: Install musl tools
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends musl-tools

- name: Set up Rust toolchain (musl)
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Build (cargo release)
run: cargo build --release --locked --bin app --target ${{ matrix.target }}

- name: Prepare artifact archive
id: prepare_artifact
env:
RELEASE_VERSION: ${{ inputs.version || github.sha }}
run: |
mkdir artifact
cp "target/${{ matrix.target }}/release/app" artifact/portabase-agent
archive="linux-${{ matrix.arch }}-release-$RELEASE_VERSION.tar.gz"
tar -czf "$archive" -C artifact portabase-agent
echo "archive=$archive" >> "$GITHUB_OUTPUT"

- name: Upload build artifact
if: ${{ inputs.draft_tag == '' }}
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.arch }}-release
path: ${{ steps.prepare_artifact.outputs.archive }}

- name: Attach asset to draft release
if: ${{ inputs.draft_tag != '' }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: gh release upload "${{ inputs.draft_tag }}" "${{ steps.prepare_artifact.outputs.archive }}" --clobber
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,25 @@ jobs:
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-linux:
needs: create-release
if: ${{ needs.create-release.result == 'success' }}
uses: ./.github/workflows/linux-release.yml
with:
version: ${{ needs.create-release.outputs.version }}
ref: ${{ needs.create-release.outputs.version }}
draft_tag: ${{ needs.create-release.outputs.draft_tag }}
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

finalize-release:
needs:
- create-release
- publish-docker
- publish-docker-ghcr
- publish-helm
- build-windows
- build-linux
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.publish_release_step.outputs.release_tag }}
Expand Down
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ aes-gcm = "0.11"
tokio-stream = "0.1.18"
url = "2.5.8"
percent-encoding = "2.3.2"
# bollard must match the version testcontainers uses (bollard-stubs is pinned
# exactly, so two bollards cannot coexist). Upgrade bollard, testcontainers and
# testcontainers-modules together.
bollard = "0.20.0"
rustls = "0.23"
globset = "0.4"
Expand All @@ -59,7 +56,7 @@ walkdir = "2.5"
libc = "0.2"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
tokio = { version = "1", features = ["full", "test-util"] }
testcontainers = "0.27.1"
testcontainers-modules = { version = "0.15.0", features = ["postgres", "redis", "valkey", "mysql", "mariadb", "mongo"] }
wiremock = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
LOG: debug
TZ: "Europe/Paris"
# TMPDIR: /scratch
EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiOGYzOTAyYjgtZmU0Yy00NmY2LWE0ODktNzE5MTNhZTgxMjg3IiwibWFzdGVyS2V5QjY0IjoiMUh0djdtWCtYVkJxL0IzUEV2WDlZZjlQeUdVZW5oRHlXemo5THRqNW90WT0ifQ=="
EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiN2I4ZjE0MjUtMDU4MC00NmJjLWFkMzAtYTBkOGE3YzFjZTkwIiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ=="
#CHUNK_SIZE_MB: "1"
#POLLING: 1
#RETRY_ATTEMPTS: 3
Expand Down
Loading
Loading