.github: import release job from Mg project

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-09-17 12:17:53 +02:00
1 parent bed65c84e6
commit c33500c372
1 file changed
+12 -37
+12 -37
View File
@@ -7,38 +7,11 @@ on:
jobs: jobs:
release: release:
name: Create GitHub release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v2
- name: Extract ChangeLog entry ...
# Hack to extract latest entry for body_path below
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
|head -n -1 > release.md
cat release.md
- name: Create release ...
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Libite (-lite) ${{ github.ref }}
body_path: release.md
draft: false
prerelease: false
tarball:
name: Build and upload release tarball name: Build and upload release tarball
needs: release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Installing dependencies ... - name: Installing dependencies ...
run: | run: |
sudo apt-get -y update sudo apt-get -y update
@@ -46,17 +19,19 @@ jobs:
- name: Creating Makefiles ... - name: Creating Makefiles ...
run: | run: |
./autogen.sh ./autogen.sh
./configure ./configure --prefix=
- name: Build release ... - name: Build release ...
run: | run: |
make release || (cat test/test-suite.log; false) make release
ls -lF ../
mkdir -p artifacts/ mkdir -p artifacts/
mv ../*.tar.* artifacts/ mv ../*.tar.* artifacts/
- name: Upload release artifacts ... - name: Extract ChangeLog entry ...
uses: skx/github-action-publish-binaries@release-0.15 run: |
env: awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |head -n -1 > release.md
cat release.md
- uses: ncipollo/release-action@v1
with: with:
releaseId: ${{ needs.release.outputs.release_id }} name: Libite (-lite) ${{ github.ref_name }}
args: artifacts/* bodyFile: "release.md"
artifacts: "artifacts/*"