mirror of
https://git.stillkill.net/Stillkill/GiteaPublish.git
synced 2026-10-22 21:42:19 +01:00
75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
name: Build Arch Package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux:latest
|
|
|
|
steps:
|
|
- name: Install Node for Actions
|
|
run: |
|
|
pacman -Syu --noconfirm nodejs
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Arch build environment
|
|
run: |
|
|
pacman -Syu --noconfirm
|
|
pacman -S --noconfirm base-devel dotnet-sdk git
|
|
#will need this later for uploading the package
|
|
dotnet publish -c Release -r linux-x64 --self-contained \
|
|
-p:PublishSingleFile=true \
|
|
-p:PublishReadyToRun=true \
|
|
-p:UseAppHost=true \
|
|
-p:DebugType=embedded \
|
|
-o "/usr/local/bin" GiteaPublish
|
|
|
|
- name: Get application version
|
|
id: get_version
|
|
run: |
|
|
VERSION=$(dotnet run -v q --property WarningLevel=0 --project GiteaPublish -- --version)
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "Application version: $VERSION"
|
|
|
|
- name: Prepare PKGBUILD
|
|
run: |
|
|
cd GiteaPublish
|
|
sed -i "s/<PKG-VER>/${{ steps.get_version.outputs.version }}/g" PKGBUILD
|
|
cat PKGBUILD
|
|
|
|
- name: Build Arch package
|
|
run: |
|
|
cd GiteaPublish
|
|
pwd
|
|
useradd -m builder
|
|
chown -R builder:builder .
|
|
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
su builder -c "makepkg -s --noconfirm"
|
|
|
|
- name: List built packages
|
|
run: |
|
|
cd GiteaPublish
|
|
pwd
|
|
ls -lah *.pkg.tar.zst
|
|
echo "package_file=$(ls *.pkg.tar.zst | head -n 1)" >> $GITHUB_OUTPUT
|
|
id: package_info
|
|
|
|
- name: Upload Arch package artifact
|
|
run: |
|
|
#I used the package to upload the package
|
|
chmod +x GiteaPublish/src/output/GiteaPublish
|
|
GiteaPublish/src/output/GiteaPublish package arch publish --username ${{ secrets.USERNAME }} --password ${{ secrets.PASSWORD }} -b https://git.stillkill.net -o Stillkill -r GiteaPublish -f "GiteaPublish/${{ steps.package_info.outputs.package_file }}"
|
|
|
|
- name: Display package info
|
|
run: |
|
|
echo "Built package version: ${{ steps.get_version.outputs.version }}"
|
|
echo "Package file: ${{ steps.package_info.outputs.package_file }}"
|
|
|