Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra committed Nov 29, 2024
1 parent cc6d73b commit f36adfc
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
release:
types:
- created

jobs:
release-libelf:
runs-on: ubuntu-latest

steps:
- name: Install deps
run: |
apt-get update
apt-get install -y m4
- name: Check out repository code
uses: actions/checkout@v3

- name: Check release tag
id: check_tag
run: |
if [[ "${{ github.event.release.tag_name }}" != libelf-* ]]; then
echo "This release tag does not start with 'libelf-', skipping."
exit 0
fi
- name: Generate m4 files
run: |
cd common/sys
m4 -I$(pwd) -D SRCDIR=$(pwd) elfdefinitions.m4 > elfdefinitions.h
cd ../../libelf
m4 -D SRCDIR=$(pwd) libelf_fsize.m4 > libelf_fsize.c
m4 -D SRCDIR=$(pwd) libelf_msize.m4 > libelf_msize.c
m4 -D SRCDIR=$(pwd) libelf_convert.m4 > libelf_convert.c
- name: Create tar.gz package
run: |
tar -czvf ${{ github.event.release.tag_name }}.tar.gz common/ libelf/ CMakeLists.txt
- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.event.release.tag_name }}.tar.gz
asset_name: ${{ github.event.release.tag_name }}.tar.gz
asset_content_type: application/gzip

0 comments on commit f36adfc

Please sign in to comment.