| 1 |
name: Release tarball |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- "**" |
| 7 |
|
| 8 |
jobs: |
| 9 |
release: |
| 10 |
name: "Release" |
| 11 |
|
| 12 |
runs-on: ubuntu-latest |
| 13 |
|
| 14 |
steps: |
| 15 |
- uses: actions/checkout@v4 |
| 16 |
- name: "Determine tag" |
| 17 |
id: "determine-tag" |
| 18 |
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/v}\"" |
| 19 |
|
| 20 |
- name: "Determine configure.ac version" |
| 21 |
id: "determine-ac" |
| 22 |
run: "echo \"::set-output name=version::`sed -n -E 's/AC_INIT\\(\\[dcfldd\\], \\[(.+?)\\],.*$/\\1/p' configure.ac`\"" |
| 23 |
|
| 24 |
- name: "Fail when tag version != configure.ac version" |
| 25 |
run: "exit 1" |
| 26 |
if: steps.determine-tag.outputs.tag != steps.determine-ac.outputs.version |
| 27 |
|
| 28 |
- name: Build and check distribution tarball |
| 29 |
run: | |
| 30 |
./autogen.sh |
| 31 |
./configure |
| 32 |
make distcheck |
| 33 |
|
| 34 |
- name: Create Release |
| 35 |
id: create_release |
| 36 |
uses: actions/create-release@v1 |
| 37 |
env: |
| 38 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 39 |
with: |
| 40 |
tag_name: v${{ steps.determine-tag.outputs.tag }} |
| 41 |
release_name: Release ${{ steps.determine-tag.outputs.tag }} |
| 42 |
draft: false |
| 43 |
prerelease: false |
| 44 |
|
| 45 |
- name: Upload Release Asset |
| 46 |
id: upload-release-asset |
| 47 |
uses: actions/upload-release-asset@v1 |
| 48 |
env: |
| 49 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 |
with: |
| 51 |
upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 52 |
asset_path: ./dcfldd-${{ steps.determine-tag.outputs.tag }}.tar.gz |
| 53 |
asset_name: dcfldd-${{ steps.determine-tag.outputs.tag }}.tar.gz |
| 54 |
asset_content_type: application/gzip |