Skip to content

Commit

Permalink
Move some things around to better support musl/arm64 from Rust.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Apr 7, 2024
1 parent 62779f9 commit cb8e8c8
Show file tree
Hide file tree
Showing 59 changed files with 263 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ jobs:
with:
ref: ${{ github.base_ref }}

- name: Restore any cached build artifacts (musl-aarch64)
uses: actions/cache/restore@v4
id: restore-musl-aarch64
with:
key: "build-cache-${{ inputs.package-name }}-${{ inputs.package-version }}-musl-aarch64"
path: "/usr/bin/${{ inputs.package-name }}_musl_arm64"

- name: Restore any cached build artifacts (musl-x86_64)
uses: actions/cache/restore@v4
id: restore-musl-x86_64
with:
key: "build-cache-${{ inputs.package-name }}-${{ inputs.package-version }}-musl-x86_64"
path: "/usr/bin/${{ inputs.package-name }}_musl_amd64"

- name: Build the package
working-directory: packages/${{ inputs.package-name }}
env:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/_build-rust-musl-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: "Step: Build Rust packages for musl-aarch64"
on:
workflow_call:
inputs:
package-name:
required: true
type: string
package-version:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-build-and-cache
cancel-in-progress: true

# Variables available to all jobs defined in this file
env:
DOCKER_BUILDKIT: 1
REGISTRY: ${{ vars.REGISTRY }}

# Declare default permissions as read only.
permissions: read-all

jobs:
generate:
runs-on: ubuntu-latest
name: Build and cache
strategy:
fail-fast: false

container:
image: ghcr.io/northwood-labs/package-builder/alpine-v3.19:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged --platform=linux/arm64

steps:
- name: Compile for musl
working-directory: packages/${{ inputs.package-name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bash ./compile-alpine-arm64.sh "${{ inputs.package-version }}"
- name: Cache the packages
uses: actions/cache/save@v4
id: cache-packages
with:
key: "build-cache-${{ inputs.package-name }}-${{ inputs.package-version }}-musl-aarch64"
path: "/usr/bin/${{ inputs.package-name }}_musl_arm64"
6 changes: 3 additions & 3 deletions .github/workflows/build-actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p actionlint -r 'rhysd/actionlint' -c '10 0 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-actionlint.yml"
- "packages/actionlint/**"
schedule:
- cron: '10 0 * * *'
- cron: "10 0 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "actionlint"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-aws-vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p aws-vault -r '99designs/aws-vault' -c '50 0 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-aws-vault.yml"
- "packages/aws-vault/**"
schedule:
- cron: '50 0 * * *'
- cron: "50 0 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "aws-vault"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-chamber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p chamber -r 'segmentio/chamber' -c '20 2 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-chamber.yml"
- "packages/chamber/**"
schedule:
- cron: '20 2 * * *'
- cron: "20 2 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "chamber"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-cloud-nuke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p cloud-nuke -r 'gruntwork-io/cloud-nuke' -c '40 2 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-cloud-nuke.yml"
- "packages/cloud-nuke/**"
schedule:
- cron: '40 2 * * *'
- cron: "40 2 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "cloud-nuke"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-cosign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p cosign -r 'sigstore/cosign' -c '10 3 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-cosign.yml"
- "packages/cosign/**"
schedule:
- cron: '10 3 * * *'
- cron: "10 3 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "cosign"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-direnv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p direnv -r 'direnv/direnv' -c '30 3 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-direnv.yml"
- "packages/direnv/**"
schedule:
- cron: '30 3 * * *'
- cron: "30 3 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "direnv"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-dive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p dive -r 'wagoodman/dive' -c '40 3 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-dive.yml"
- "packages/dive/**"
schedule:
- cron: '40 3 * * *'
- cron: "40 3 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "dive"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-driftwood.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p driftwood -r 'trufflesecurity/driftwood' -c '10 4 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-driftwood.yml"
- "packages/driftwood/**"
schedule:
- cron: '10 4 * * *'
- cron: "10 4 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "driftwood"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-editorconfig-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p editorconfig-checker -r 'editorconfig-checker/editorconfig-checker' -c '30 4 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-editorconfig-checker.yml"
- "packages/editorconfig-checker/**"
schedule:
- cron: '30 4 * * *'
- cron: "30 4 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "editorconfig-checker"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-eza.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p eza -r 'eza-community/eza' -c '40 4 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-eza.yml"
- "packages/eza/**"
schedule:
- cron: '40 4 * * *'
- cron: "40 4 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "eza"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-fd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# DO NOT EDIT THIS FILE!
#
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p fd -r 'sharkdp/fd' -c '50 4 * * *'
################################################################################
Expand All @@ -24,7 +24,7 @@ on:
- ".github/workflows/build-fd.yml"
- "packages/fd/**"
schedule:
- cron: '50 4 * * *'
- cron: "50 4 * * *"

defaults:
run:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: Build and cache
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main
uses: northwood-labs/package-building/.github/workflows/_build-and-cache.yml@main
secrets: inherit
with:
package-name: "fd"
Expand Down
Loading

0 comments on commit cb8e8c8

Please sign in to comment.