Initial commit

This commit is contained in:
timansky
2024-12-04 22:27:16 +05:00
commit c252c0310f
21 changed files with 1545 additions and 0 deletions
+73
View File
@@ -0,0 +1,73 @@
name: Build deb
concurrency:
group: branch-${{ github.ref_name }}
cancel-in-progress: true
on:
workflow_call:
outputs:
deb:
description: "Deb artifact url FQIN"
value: ${{ jobs.config.outputs.fqin_release }}
jobs:
build-deb:
name: Build deb
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
path: src
- name: Install depedencies
working-directory: ./src
run: |
sudo apt-get build-dep .
- name: Generate changelog
working-directory: ./src
run: |
pkgname=libpve-storage-purestorage-perl
tag_list=$(git tag -l | grep -ve '-rc\.[0-9]$' | grep -ve '-beta\.[0-9]$' | sort -V)
for tag in ${tag_list}; do
tag_header="$tag^..$tag"
tag_info=$prevtag..$tag
tag_version=$(echo $tag | cut -c2-)-1
if [[ "$prevrag" == "" ]]; then
tag_header="$tag"
tag_info="$tag"
elif [[ "$tag" == "$prevtag" ]]; then
continue
fi
echo >> changelog
git log --pretty='format: -- %aN <%aE> %aD%n%n' $tag_header >> changelog
git log --pretty=format:' * %s%n' $tag_info >> changelog
echo "" >> changelog
echo "$pkgname ($tag_version) stable; urgency=medium" >> changelog
prevtag=$tag
done
tac changelog > debian/changelog
- name: Build deb
working-directory: ./src
run: |
dpkg-buildpackage -us -uc
- name: generate sha256sums
run: |
sha256sum *.deb > sha256sums
- id: artifact-upload
uses: actions/upload-artifact@v4
with:
name: deb-artifact-${{ github.sha }}
if-no-files-found: error
compression-level: 0
overwrite: true
path: |
*.deb
sha256sums
+56
View File
@@ -0,0 +1,56 @@
name: Release
run-name: Release-${{ github.ref_name }}-${{ github.run_number }}
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]'
jobs:
test:
name: Test release tag
runs-on: ubuntu-22.04
steps:
- run: |
echo ${{ github.ref }}
- if: ${{ github.ref_type != 'tag' }}
run: |
echo "::error::${{ github.ref }} branch is not a release tag"; exit 1
build:
name: Make deb package
needs:
- test
uses: ./.github/workflows/_deb.yml
secrets: inherit
release:
name: Release
needs:
- build
runs-on: ubuntu-22.04
steps:
- id: artifact-download
uses: actions/download-artifact@v4
with:
name: deb-artifact-${{ github.sha }}
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
generate_release_notes: true
make_latest: true
prerelease: true
files: |
*.deb
sha256sums