diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe0c452..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: @@ -63,6 +65,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 +96,33 @@ 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: 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 }} + + - 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)