Skip to content

Add build job dependency #3

Add build job dependency

Add build job dependency #3

Workflow file for this run

name: Build
on:
push:
schedule:
# Run every day at 5:20
- cron: '20 5 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
arch: aarch64
- platform: linux/arm64/v8
arch: x86_64
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: matrix.platform != linux/amd64

Check failure on line 27 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 27, Col: 11): Unexpected symbol: 'linux/amd64'. Located at position 20 within expression: matrix.platform != linux/amd64
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.platform }}
- name: Build packages (${{ matrix.platform }})
run: >
docker run
-it
--rm
--platform "${{ matrix.platform }}"
--user "$(id -u "$USER"):$(id -g "$USER")"
--mount type=bind,src="$PWD",dst=/src/arch-repo
--workdir /src/arch-repo
--entrypoint /src/arch-repo/install-deps-and-build-pkgs
archlinux:base-devel
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch }}
path: build
retention-days: 1
release:
if: github.repository == 'fwcd/arch-repo'
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Download build artifacts for each architecture
uses: actions/download-artifact@v3
with:
path: build
- name: Build package database
run: ./build-db
- name: Set up Git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Update PKGBUILDs and .SRCINFOs
run: cp -r build/x86_64/src/ .
- name: Commit updates
run: |
git add -A
git commit --allow-empty -m "Update packages ($(date '+%Y-%m-%d-%H-%M'))"
- name: Push changes
run: git push
- name: Publish release
if: github.ref == 'refs/heads/main'
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="$(date '+%Y-%m-%d-%H-%M')"
gh release create --title "$tag" "$tag" || true
gh release upload --clobber "$tag" db/*