Skip to content

Commit

Permalink
fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
h3fang committed Apr 4, 2024
1 parent 08bf32d commit 8e276b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/actions/makepkg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ FROM archlinux:base-devel

RUN pacman -Syu --needed --noconfirm git

RUN groupadd -f -r wheel
RUN useradd -d /builder -m builder
RUN useradd -m builder
RUN echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

USER builder
WORKDIR /builder
WORKDIR /home/builder

COPY entrypoint.sh /entrypoint.sh

Expand Down
6 changes: 2 additions & 4 deletions .github/actions/makepkg/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

set -eu

if [ -d "/github" ]; then
sudo chown -R builder /github/workspace /github/home
fi

sudo sed -i '/^CFLAGS=/ s/-march=x86-64 -mtune=generic/-march='"${INPUT_ARCH}"'/' /etc/makepkg.conf
sudo sed -i '/^options=(/ s/\bdebug\b/!debug/' /etc/makepkg.conf
sudo sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc)"/' /etc/makepkg.conf

sudo chown -R builder /github/workspace /github/home
mkdir -p pkgs

cd "${INPUT_PKG}"
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,39 @@ jobs:
pkg: [battery-notifications, cdns, gammastep, networkd-notify-git, pacfilter, python-mapbox-earcut, yacd]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
uses: ./.github/actions/makepkg
with:
arch: znver2
pkg: ${{ matrix.pkg }}
- name: Archive packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packages
name: ${{ matrix.pkg }}
path: pkgs/
release:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/download-artifact@master
- uses: actions/download-artifact@v4
with:
name: packages
path: pkgs/
merge-multiple: true
- uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1
with:
tag: latest
name: Optimized packages for AMD Zen 2
omitBody: true
commit: ${{ github.sha }}
artifacts: "pkgs/*.pkg.tar.zst"
artifacts: "pkgs/*"
draft: false
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8e276b0

Please sign in to comment.