feat(github): added job to generate matrix for building packages

This commit is contained in:
Wittano Bonarotti 2024-04-15 20:56:48 +02:00
parent 5df586f5e0
commit 9577ae70bb
No known key found for this signature in database
GPG Key ID: 81EC1690D9E354CF

View File

@ -19,37 +19,22 @@ jobs:
uses: DeterminateSystems/nix-installer-action@v9
- name: Check repository
run: nix flake check
generate-matrix:
name: Generate matrix data for build job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate matrix
run: |
THEMES=$(ls assets/themes | tr '[:upper:]' '[:lower:]' | sed 's/\./_/g' | jq --raw-input | jq --slurp -c)
echo "themes=$THEMES" >> $GITHUB_OUTPUT
build:
needs:
- generate-matrix
strategy:
matrix:
# Remember. Theme name in pipeline has 2 rules:
# - lower case names e.g. RuaMei -> ruamei
# - each '.' must be replaced by "_" e.g Dr.Ratio -> dr_ratio
# Those requiements are only for nix packages
theme: [
jingliu,
aventurine,
acheron,
argenti,
blackswan,
dr_ratio,
hanya,
huohuo,
luocha,
ruanmei,
sparkle,
jingliu_cn,
aventurine_cn,
acheron_cn,
argenti_cn,
blackswan_cn,
dr_ratio_cn,
hanya_cn,
huohuo_cn,
luocha_cn,
ruanmei_cn,
sparkle_cn
]
theme: ${{ fromJSON(needs.generate-matrix.outputs.themes) }}
name: Build Nix
runs-on: ubuntu-latest
steps: