mirror of
https://git.stillkill.net/Stillkill/GiteaPublish.git
synced 2026-10-22 13:32:19 +01:00
Workflow test
This commit is contained in:
1 parent
518159ea7f
commit
ef25216552
17 files changed
+876
-25
No files matched your search
@@ -0,0 +1,72 @@
|
||||
name: Build Arch Package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: archlinux:latest
|
||||
|
||||
steps:
|
||||
- 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
|
||||
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 }}"
|
||||
|
||||
Reference in new issue
Block a user