]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Add GitHub Action to automatically build and upload release assets.
authorFlorian Forster <octo@collectd.org>
Wed, 7 Feb 2024 08:21:19 +0000 (09:21 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 7 Feb 2024 08:21:19 +0000 (09:21 +0100)
.github/workflows/release.yml [new file with mode: 0644]

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644 (file)
index 0000000..d146e91
--- /dev/null
@@ -0,0 +1,35 @@
+name: Release
+
+on:
+  release:
+    types: [released, prereleased]
+
+permissions:
+  contents: write
+
+defaults:
+  run:
+    shell: bash
+
+jobs:
+  asset:
+    runs-on: ubuntu-latest
+    container: collectd/ci:debian12
+    steps:
+    - uses: actions/checkout@v4
+    - run: |
+        git config --global --add safe.directory "$(pwd)"
+        git submodule init -- opentelemetry-proto
+        git submodule update -- opentelemetry-proto
+    - name: Generate configure script
+      run: ./build.sh
+    - name: Run configure script
+      run: ./configure
+    - name: Run make distcheck
+      run: make -j $(nproc) distcheck
+    - name: Upload distribution package
+      run: |
+        ls -l *.bz2
+        [[ -e "${GITHUB_REF#refs/tags/}.tar.bz2" ]] && gh release upload "${GITHUB_REF}" "${GITHUB_REF#refs/tags/}.tar.bz2"
+      env:
+        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}