From 7795a07a2fe0fa0d1d09b28c94333182cc18db14 Mon Sep 17 00:00:00 2001 From: Aritra Dey Date: Sun, 2 Mar 2025 20:28:26 +0530 Subject: [PATCH 1/2] feat: Automate SIPNET binary builds and manual release --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ Makefile | 10 ++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe0c452..b61fdf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,13 @@ jobs: exit 1 fi + # upload SIPNET binaries + - name: Upload SIPNET Binaries + uses: actions/upload-artifact@v2 + with: + name: sipnet-binaries + path: ./sipnet + # Run Unit Tests test: needs: build @@ -87,3 +94,32 @@ jobs: - name: Run Unit Tests run: make testrun + # Create Release + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.sha }} + release_name: Release ${{ github.sha }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./sipnet + asset_name: sipnet + asset_content_type: application/octet-stream diff --git a/Makefile b/Makefile index 2500241..589143c 100755 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ DOXYFILE = docs/Doxyfile DOXYGEN_HTML_DIR = docs/html DOXYGEN_LATEX_DIR = docs/latex -all: estimate sipnet transpose subsetData +all: estimate sipnet transpose subsetData release # Only update docs if source files or Doxyfile have changed document: .doxygen.stamp @@ -51,9 +51,15 @@ transpose: $(TRANSPOSE_OFILES) subsetData: $(SUBSET_DATA_OFILES) $(LD) -o subsetData $(SUBSET_DATA_OFILES) $(LIBLINKS) +release: sipnet + mkdir -p release + cp sipnet release/ + tar -czvf release/sipnet.tar.gz -C release sipnet + rm release/sipnet + clean: rm -f $(ESTIMATE_OFILES) $(SIPNET_OFILES) $(TRANSPOSE_OFILES) $(SUBSET_DATA_OFILES) estimate sensTest sipnet transpose subsetData - rm -rf $(DOXYGEN_HTML_DIR) $(DOXYGEN_LATEX_DIR) + rm -rf $(DOXYGEN_HTML_DIR) $(DOXYGEN_LATEX_DIR) release # UNIT TESTS SIPNET_TEST_DIRS:=$(shell find tests/sipnet -type d -mindepth 1 -maxdepth 1) From 8d1f7e9fb21cb9caa353dfdfc36e56f8accb731a Mon Sep 17 00:00:00 2001 From: Aritra Dey Date: Fri, 7 Mar 2025 01:17:53 +0530 Subject: [PATCH 2/2] fix: update CI workflow to trigger releases only on merges to the master branch --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b61fdf6..78555d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: CI on: push: + tags: + - 'v*.*.*' branches: - master pull_request: @@ -105,14 +107,15 @@ jobs: - name: Create Release id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + This release includes binary builds for historical SIPNET versions. + draft: true # Create the release as a draft env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.sha }} - release_name: Release ${{ github.sha }} - draft: false - prerelease: false - name: Upload Release Asset uses: actions/upload-release-asset@v1