From 73d25540a09e65f9c9896de2f3298d0b4c97556e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Thu, 16 Apr 2020 11:11:34 +0200 Subject: [PATCH] Add Release Upload (#6) --- .github/workflows/linux.yml | 39 ++++++++++++++++++++++++----------- .github/workflows/windows.yml | 21 ++++++++++++++++--- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0f4f0010d..6a043cb54 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -5,6 +5,9 @@ on: branches: [ master ] pull_request: branches: [ master ] + release: + types: + - published jobs: formatting: @@ -28,14 +31,14 @@ jobs: mode: [Debug, Release] lint: [Off, On] exclude: - - mode: Release - cxx: clang-9-san - - mode: Release - lint: On - - cxx: gcc-9 - lint: On - - cxx: clang-9-san - lint: On + - mode: Release + cxx: clang-9-san + - mode: Release + lint: On + - cxx: gcc-9 + lint: On + - cxx: clang-9-san + lint: On env: CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_NOHASHDIR: true @@ -70,7 +73,7 @@ jobs: cmake --build build --target motis motis-test motis-itest path-prepare parking-prepare ppr-preprocess osrm-extract osrm-contract at-example motis-eval motis-intermodal-eval ccache -s - - name: Run Test Mode + - name: Run Test Mode run: | ./build/motis --mode test \ --dataset.path base/loader/test_resources/hrd_schedules/single-ice \ @@ -135,11 +138,23 @@ jobs: mv build/deps/address-typeahead/at-example motis mv build/deps/ppr/ppr-preprocess motis mv deps/osrm-backend/profiles motis - tar cjf motis-${{ github.sha }}-linux.tar.bz2 motis + tar cjf motis-linux.tar.bz2 motis - name: Upload Distribution if: matrix.mode == 'Release' && matrix.cxx == 'gcc-9' uses: actions/upload-artifact@v1 with: - name: motis-${{ github.sha }}-linux.tar.bz2 - path: motis-${{ github.sha }}-linux.tar.bz2 + name: motis-linux + path: motis-linux.tar.bz2 + + # ==== RELEASE ==== + - name: Upload Release + if: github.event.action == 'published' && matrix.mode == 'Release' && matrix.cxx == 'gcc-9' + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./motis-linux.tar.bz2 + asset_name: motis-linux.tar.bz2 + asset_content_type: application/x-tar \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 661f1b5c2..ecf27cd8c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -5,6 +5,9 @@ on: branches: [ master ] pull_request: branches: [ master ] + release: + types: + - published jobs: build: @@ -67,7 +70,7 @@ jobs: - name: Create Distribution if: matrix.mode == 'Release' run: > - 7z a motis-${{ github.sha }}-windows.zip + 7z a motis-windows.zip .\build\motis.exe .\build\path-prepare.exe .\build\parking-prepare.exe @@ -82,5 +85,17 @@ jobs: if: matrix.mode == 'Release' uses: actions/upload-artifact@v1 with: - name: motis-${{ github.sha }}-windows.zip - path: motis-${{ github.sha }}-windows.zip + name: motis-windows + path: motis-windows.zip + + # ==== RELEASE ==== + - name: Upload Release + if: github.event.action == 'published' && matrix.mode == 'Release' + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./motis-windows.zip + asset_name: motis-windows.zip + asset_content_type: application/zip