Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance cross-check workflow with additional target configurations and enable cross-compilation for specific platforms #70

Merged
merged 13 commits into from
Nov 27, 2024
Merged
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
38 changes: 17 additions & 21 deletions .github/workflows/cross-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:

jobs:
cross-check:
name: Cross checking ${{ matrix.job.target }}
name: Cross checking ${{ matrix.job.target }} on ${{ matrix.rust }}
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
Expand All @@ -36,12 +36,11 @@ jobs:
target: x86_64-pc-windows-msvc
architecture: x86_64
use-cross: false
# Disabled for now, as aws-lc-sys needs bindgen-cli for manual build with CMake in cross
# - os: windows-latest
# os-name: windows
# target: x86_64-pc-windows-gnu
# architecture: x86_64
# use-cross: false
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-gnu
architecture: x86_64
use-cross: false
- os: macos-13
os-name: macos
target: x86_64-apple-darwin
Expand All @@ -51,7 +50,7 @@ jobs:
os-name: macos
target: aarch64-apple-darwin
architecture: arm64
use-cross: false
use-cross: true
- os: ubuntu-latest
os-name: linux
target: x86_64-unknown-linux-gnu
Expand All @@ -67,7 +66,6 @@ jobs:
target: aarch64-unknown-linux-gnu
architecture: arm64
use-cross: true
# Check because of Container images for rustic-rs
- os: ubuntu-latest
os-name: linux
target: aarch64-unknown-linux-musl
Expand All @@ -78,18 +76,16 @@ jobs:
target: i686-unknown-linux-gnu
architecture: i686
use-cross: true
# Disabled for now, as aws-lc-sys needs bindgen-cli for manual build with CMake in cross
# - os: ubuntu-latest
# os-name: netbsd
# target: x86_64-unknown-netbsd
# architecture: x86_64
# use-cross: true
# Disabled for now, as aws-lc-sys needs bindgen-cli for manual build with CMake in cross
# - os: ubuntu-latest
# os-name: linux
# target: armv7-unknown-linux-gnueabihf
# architecture: armv7
# use-cross: true
- os: ubuntu-latest
os-name: netbsd
target: x86_64-unknown-netbsd
architecture: x86_64
use-cross: true
- os: ubuntu-latest
os-name: linux
target: armv7-unknown-linux-gnueabihf
architecture: armv7
use-cross: true

steps:
- name: Checkout repository
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
with:
context: containers
push: true
# cross-compiling arm64 is currently not working
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ghcr.io/rustic-rs/rustic_server:latest,ghcr.io/rustic-rs/rustic_server:${{ github.ref_name }}
build-args: RUSTIC_SERVER_VERSION=${{ github.ref_name }}
48 changes: 47 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,60 @@ jobs:

gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*

publish-homebrew-formula:
needs:
- plan
- host
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
GITHUB_USER: "axo bot"
GITHUB_EMAIL: "[email protected]"
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- uses: actions/checkout@v4
with:
repository: "rustic-rs/homebrew-tap"
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# So we have access to the formula
- name: Fetch homebrew formulae
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: Formula/
merge-multiple: true
# This is extra complex because you can make your Formula name not match your app name
# so we need to find releases with a *.rb file, and publish with that filename.
- name: Commit formula files
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"

for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
name=$(echo "$filename" | sed "s/\.rb$//")
version=$(echo "$release" | jq .app_version --raw-output)

export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
brew update
# We avoid reformatting user-provided data such as the app description and homepage.
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true

git add "Formula/${filename}"
git commit -m "${name} ${version}"
done
git push

announce:
needs:
- plan
- host
- publish-homebrew-formula
# use "always() && ..." to allow us to wait for all publish jobs while
# still allowing individual publish jobs to skip themselves (for prereleases).
# "host" however must run to completion, no skipping allowed!
if: ${{ always() && needs.host.result == 'success' }}
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading