mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-09 14:33:03 +02:00
Compare commits
3 commits
a873329a42
...
a3422d5625
Author | SHA1 | Date | |
---|---|---|---|
|
a3422d5625 |
||
|
f5003206fa |
||
|
dbd5d347ec |
1 changed files with 42 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
name: Build / Debian DEB
|
name: Build / Debian DEB
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "build-debian-${{ github.ref }}"
|
group: "build-debian-${{ forge.ref }}"
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
@ -27,8 +27,31 @@ jobs:
|
||||||
id: debian_version
|
id: debian_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(cat /etc/debian_version)
|
VERSION=$(cat /etc/debian_version)
|
||||||
|
DISTRIBUTION=$(lsb_release -sc 2>/dev/null)
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Debian version: $VERSION"
|
echo "distribution=$DISTRIBUTION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Debian distribution: $DISTRIBUTION ($VERSION)"
|
||||||
|
|
||||||
|
- name: Get package revision and component
|
||||||
|
id: package_meta
|
||||||
|
run: |
|
||||||
|
# REVISION is appended to the package version, COMPONENT is used in
|
||||||
|
# apt's repository config like a git repo branch
|
||||||
|
if [[ "${{ forge.ref }}" == "refs/tags/"* ]]; then
|
||||||
|
COMPONENT="stable"
|
||||||
|
REVISION="stable"
|
||||||
|
elif [ "${{ forge.ref_name }}" = "main" ]; then
|
||||||
|
COMPONENT="dev"
|
||||||
|
REVISION="dev"
|
||||||
|
else
|
||||||
|
# Use sanitized ref name for the component
|
||||||
|
COMPONENT=$(echo "${{ forge.ref_name }}" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)
|
||||||
|
# and use SHA for the revision
|
||||||
|
REVISION=${{ forge.sha }}
|
||||||
|
fi
|
||||||
|
echo "component=$COMPONENT" >> $GITHUB_OUTPUT
|
||||||
|
echo "revision=$REVISION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Target component: $COMPONENT revision $REVISION"
|
||||||
|
|
||||||
- name: Checkout repository with full history
|
- name: Checkout repository with full history
|
||||||
uses: https://code.forgejo.org/actions/checkout@v4
|
uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
@ -73,7 +96,7 @@ jobs:
|
||||||
- name: Run cargo-deb
|
- name: Run cargo-deb
|
||||||
id: cargo_deb
|
id: cargo_deb
|
||||||
run: |
|
run: |
|
||||||
DEB_PATH=$(cargo deb)
|
DEB_PATH=$(cargo deb --deb-revision ${{ steps.package_meta.outputs.revision }})
|
||||||
echo "path=$DEB_PATH" >> $GITHUB_OUTPUT
|
echo "path=$DEB_PATH" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Test deb installation
|
- name: Test deb installation
|
||||||
|
@ -93,3 +116,19 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: continuwuity
|
name: continuwuity
|
||||||
path: ${{ steps.cargo_deb.outputs.path }}
|
path: ${{ steps.cargo_deb.outputs.path }}
|
||||||
|
|
||||||
|
- name: Publish to Forgejo package registry
|
||||||
|
if: ${{ forge.event_name == 'push' || forge.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
OWNER="continuwuation"
|
||||||
|
DISTRIBUTION=${{ steps.debian_version.outputs.distribution }}
|
||||||
|
COMPONENT=${{ steps.package_meta.outputs.component }}
|
||||||
|
DEB=${{ steps.cargo_deb.outputs.path }}
|
||||||
|
|
||||||
|
echo "Publishing: $DEB in component $COMPONENT for distribution $DISTRIBUTION"
|
||||||
|
|
||||||
|
curl --fail-with-body \
|
||||||
|
-X PUT \
|
||||||
|
-H "Authorization: token ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}" \
|
||||||
|
--upload-file "$DEB" \
|
||||||
|
"${{ forge.server_url }}/api/packages/$OWNER/debian/pool/$DISTRIBUTION/$COMPONENT/upload"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue