templates/.github/workflows/build.yaml

102 lines
3.2 KiB
YAML

name: build
on:
push:
branches:
- main
jobs:
changedpkgs:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.matrix.outputs.pkg }}
steps:
- id: matrix
run: |
echo "pkg=[\"dotter-bin\",\"filtile-bin\",\"git-bug-git\",\"ly-git\"]" >> $GITHUB_OUTPUT
- run: |
echo "${{ steps.matrix.outputs.pkg }}"
build:
needs: [ changedpkgs ]
runs-on: ubuntu-22.04
strategy:
max-parallel: 1
matrix:
arch: [x86_64, x86_64-musl]
pkg: ${{fromJSON(needs.changedpkgs.outputs.matrix)}}
env:
XBPS_PASSPHRASE: ${{ secrets.SIGN_PASS }}
XBPS_TARGET_ARCH: ${{ matrix.arch }}
steps:
- name: checkout local templates
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
path: added-packages
- name: checkout upstream templates
uses: actions/checkout@v4
with:
repository: void-linux/void-packages
ref: master
fetch-depth: 1
path: upstream-packages
- name: copy
run: cp -rv added-packages/srcpkgs/* upstream-packages/srcpkgs
- name: prepare xbps-static
run: |
mkdir -p /opt/xbps
curl -LO http://repo-default.voidlinux.org/static/xbps-static-latest.x86_64-musl.tar.xz
tar xvf xbps-static-latest.x86_64-musl.tar.xz -C /opt/xbps
rm xbps-static-latest.x86_64-musl.tar.xz
- name: Prepare masterdir
working-directory: upstream-packages
run: |
export PATH="/tmp/bin:/opt/xbps/usr/bin/:$PATH"
common/travis/set_mirror.sh &&
common/travis/fetch-xtools.sh
- name: free space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
- name: build
working-directory: upstream-packages
run: |
export PATH="/tmp/bin:/opt/xbps/usr/bin/:$PATH"
./xbps-src -m masterdir-${{ matrix.arch }} -A ${{ matrix.arch }} binary-bootstrap
./xbps-src pkg -j4 -m masterdir-${{ matrix.arch }} dotter-bin
- name: sign
working-directory: upstream-packages/hostdir/binpkgs/
run: |
export PATH="/tmp/bin:/opt/xbps/usr/bin/:$PATH"
xbps-rindex -r $PWD
xbps-rindex -s --signedby "${{ secrets.SIGNER }}" --privkey <(printf '%s' "${{ secrets.PRIV_KEY }}") $PWD
xbps-rindex -S --privkey <(printf '%s' "${{ secrets.PRIV_KEY }}") $PWD/*.xbps
xbps-rindex -c $PWD
- name: checksum
working-directory: upstream-packages/hostdir/binpkgs/
run: |
for pkg in *.xbps; do sha256sum "$pkg" | tee "$pkg".sha256sum; done
for pkg in *.xbps; do sha512sum "$pkg" | tee "$pkg".sha512sum; done
- name: publish to pages
uses: peaceiris/actions-gh-pages@v4
# If you're changing the branch from main,
# also change the `main` in `refs/heads/main`
# below accordingly.
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: upstream-packages/hostdir/binpkgs