Files
packages/.github/workflows/build.yml
T
windowsboy111 99d68cef07 Fix arch
2023-01-30 17:36:21 +08:00

47 lines
1.6 KiB
YAML

name: Build Packages
on:
workflow_dispatch:
inputs:
packages:
description: Packages to Build
required: true
jobs:
parse:
outputs:
pkgs: ${{ steps.parsing.outputs.pkgs }}
runs-on: ubuntu-latest
steps:
- name: Parse Input
id: parsing
run: echo "${{ inputs.packages }}" | sed 's/ /\n/g' | sed 's/$/\//g' | jq -R . | jq -s . | jq -c . | sed 's/^/pkgs=/' >> $GITHUB_OUTPUT
build:
needs: parse
strategy:
matrix:
pkg: ${{ fromJson(needs.parse.outputs.pkgs) }}
version: ["38"]
arch: ["x86_64", "aarch64"]
fail-fast: false
runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }}
container:
image: ghcr.io/terrapkg/builder:f38
options: --cap-add=SYS_ADMIN --privileged
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 1
- name: Set up git repository
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Build with Anda
shell: bash
run: anda build "${{ matrix.pkg }}pkg" --package rpm -c anda-${{ matrix.version }}-${{ matrix.arch }} -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}"
- name: Upload packages to subatomic
run: |
subatomic-cli upload --prune \
--server https://subatomic.fyralabs.com \
--token ${{ secrets.SUBATOMIC_TOKEN }} \
terra${{ matrix.version }} anda-build/rpm/rpms/*