mirror of
https://git.stillkill.net/Stillkill/GiteaPublish.git
synced 2026-10-22 05:32:18 +01:00
Add Debian package support and publish workflow
This commit is contained in:
1 parent
bd1478bca1
commit
79cb442d35
8 files changed
+319
-3
No files matched your search
File renamed without changes.
@@ -0,0 +1,62 @@
|
||||
name: Publish Debian Package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'GiteaPublish/**'
|
||||
- '.gitea/workflows/publish-debian.yaml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
- name: Build GiteaPublish Tool
|
||||
run: |
|
||||
dotnet publish GiteaPublish/GiteaPublish.csproj -c Release -r linux-x64 --self-contained \
|
||||
-p:PublishSingleFile=true \
|
||||
-p:PublishReadyToRun=true \
|
||||
-p:UseAppHost=true \
|
||||
-o ./publish-tool
|
||||
|
||||
- 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: Build Debian Package
|
||||
run: |
|
||||
sed -i "s/<PKG-VER>/${{ steps.get_version.outputs.version }}/g" debian/control
|
||||
mkdir -p package/usr/bin
|
||||
cp ./publish-tool/GiteaPublish package/usr/bin/gitea-publish
|
||||
mkdir -p package/DEBIAN
|
||||
cp debian/control package/DEBIAN/
|
||||
chmod 755 package/usr/bin/gitea-publish
|
||||
chmod 755 package/DEBIAN
|
||||
chmod 644 package/DEBIAN/control
|
||||
dpkg-deb --build package gitea-publish_${{ steps.get_version.outputs.version }}_amd64.deb
|
||||
|
||||
- name: Publish to Gitea
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GITEA_USERNAME: ${{ github.actor }}
|
||||
run: |
|
||||
./publish-tool/GiteaPublish package debian publish \
|
||||
--username "${GITEA_USERNAME}" \
|
||||
--password "${GITEA_TOKEN}" \
|
||||
--owner "${{ github.repository_owner }}" \
|
||||
--distribution "stable" \
|
||||
--component "main" \
|
||||
--file "gitea-publish_${{ steps.get_version.outputs.version }}_amd64.deb" \
|
||||
--base-url "${{ github.server_url }}"
|
||||
Reference in new issue
Block a user