Port action changes in main to f38 (#299)

* Port over actions changes to f38

* oopsies
This commit is contained in:
lleyton
2023-03-19 16:46:23 -07:00
committed by GitHub
parent 9507be3629
commit f35c82bd64
2 changed files with 44 additions and 13 deletions
+36 -2
View File
@@ -7,6 +7,9 @@ on:
- anda/**
branches:
- f38
pull_request:
branches:
- f38
workflow_dispatch:
workflow_call:
@@ -25,8 +28,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- run: git pull
fetch-depth: 0
#- run: git checkout HEAD^
# - name: Generate Build matrix
# id: generate_build_matrix
# # generate build matrix by checking out changes in anda/
# run: |
# # get the list of changed folders in the current commit, including subfolders
# changed_folders=$(git diff --name-only HEAD^ | grep -oP 'anda\/(.+)(\/|\$)' | sort -u )
# echo "Changed folders: $changed_folders"
# # if changed_folders is empty then set is empty to true
# if [ -z "$changed_folders" ]; then
# echo "::set-output name=is_empty::true"
# else
# echo "::set-output name=is_empty::false"
# fi
# # turn it into a json array
# build_matrix=$(echo "$changed_folders" | jq -R . | jq -s . | jq -c .)
# echo "::set-output name=build_matrix::$build_matrix"
# #echo "::set-output name=build_matrix::$build_matrix"
- name: Generate build matrix
id: generate_build_matrix
run: |
@@ -50,7 +72,19 @@ jobs:
extraArgs: -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}"
andaRepo: https://github.com/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo
- id: art
run: |
NAME=${{ matrix.pkg.pkg }}-${{ matrix.pkg.arch }}-${{ matrix.version }}
x=${NAME//\//@}
echo "name=$x" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.art.outputs.name }}
path: anda-build/rpm/rpms/*
- name: Upload packages to subatomic
if: github.event_name != 'pull_request'
run: |
subatomic-cli upload --prune \
--server https://subatomic.fyralabs.com \
+8 -11
View File
@@ -3,14 +3,14 @@ on:
workflow_dispatch:
inputs:
packages:
description: Packages to Build
description: "Packages to Build"
required: true
jobs:
parse:
outputs:
pkgs: ${{ steps.parsing.outputs.pkgs }}
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- name: Parse Input
id: parsing
@@ -28,16 +28,13 @@ jobs:
image: ghcr.io/terrapkg/builder:f38
options: --cap-add=SYS_ADMIN --privileged
steps:
- uses: actions/checkout@v3
- uses: terrapkg/anda-build@main
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: "${{ matrix.pkg }}pkg"
mockConfig: anda-37-${{ matrix.arch }}
extraArgs: -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}"
andaRepo: https://github.com/terrapkg/subatomic-repos/raw/main/terra38.repo
- name: Upload packages to subatomic
run: |
subatomic-cli upload --prune \