From c6c7e6457f695223cc5e2cda39201c69e3453aba Mon Sep 17 00:00:00 2001 From: Camille Mougey Date: Mon, 27 Jul 2020 10:46:30 +0200 Subject: [PATCH 1/5] MLAR auto-release --- .github/workflows/mlar_release.yml | 120 +++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 .github/workflows/mlar_release.yml diff --git a/.github/workflows/mlar_release.yml b/.github/workflows/mlar_release.yml new file mode 100644 index 00000000..01c60462 --- /dev/null +++ b/.github/workflows/mlar_release.yml @@ -0,0 +1,120 @@ +name: mlar release + +on: + push: + tags: + - "mlar-v*" + +env: + RELEASE_BIN: wrangler + RELEASE_DIR: artifacts + GITHUB_REF: "${{ github.ref }}" + LINUX_TARGET: x86_64-unknown-linux-musl + + # Space separated paths to include in the archive. + RELEASE_ADDS: README.md + +jobs: + build: + strategy: + matrix: + build: [linux, macos, windows] + include: + - build: linux + os: ubuntu-latest + target: x86_64-unknown-linux-musl + cargo_build: --target x86_64-unknown-linux-musl + - build: macos + os: macos-latest + - build: windows + os: windows-latest + extension: .exe + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Set target if any + if: matrix.target + run: rustup target add ${{ matrix.target }} + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features --all --exclude mla-fuzz-afl --verbose ${{ matrix.cargo_build }} + - name: Run tests + run: cargo test --all --exclude mla-fuzz-afl --release --verbose + - name: Upload resulting 'mlar' + uses: actions/upload-artifact@v1 + with: + name: mlar-${{ matrix.build }} + path: ./target/release/mlar${{ matrix.extension }} + + release: + # From https://github.com/cloudflare/wrangler/blob/master/.github/workflows/release.yml + name: GitHub Release + needs: build + runs-on: ubuntu-latest + steps: + - name: Query version number + id: get_version + shell: bash + run: | + echo "using version tag ${GITHUB_REF:15}" + echo ::set-output name=version::"${GITHUB_REF:15}" + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: mlar-${{ steps.get_version.outputs.VERSION }} + release_name: mlar-${{ steps.get_version.outputs.VERSION }} + + - name: Download Linux artifact + uses: actions/download-artifact@v1 + with: + name: mlar-linux + + - name: Release Linux artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./mlar + asset_content_type: application/octet-stream + asset_name: mlar-linux-static-${{ steps.get_version.outputs.VERSION }} + + - name: Download Windows artifact + uses: actions/download-artifact@v1 + with: + name: mlar-windows + + - name: Release Windows artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./mlar.exe + asset_content_type: application/octet-stream + asset_name: mlar-windows-${{ steps.get_version.outputs.VERSION }} + + - name: Download MacOS artifact + uses: actions/download-artifact@v1 + with: + name: mlar-macos + + - name: Release MacOS artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./mlar + asset_content_type: application/octet-stream + asset_name: mlar-macos-${{ steps.get_version.outputs.VERSION }} From 16c5d420f1f6559ffc28f665540bf7bdf2e3927c Mon Sep 17 00:00:00 2001 From: Camille Mougey Date: Mon, 27 Jul 2020 11:08:24 +0200 Subject: [PATCH 2/5] Test2 --- .github/workflows/mlar_release.yml | 38 +++++++++++++----------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/mlar_release.yml b/.github/workflows/mlar_release.yml index 01c60462..4226b14e 100644 --- a/.github/workflows/mlar_release.yml +++ b/.github/workflows/mlar_release.yml @@ -6,13 +6,7 @@ on: - "mlar-v*" env: - RELEASE_BIN: wrangler - RELEASE_DIR: artifacts GITHUB_REF: "${{ github.ref }}" - LINUX_TARGET: x86_64-unknown-linux-musl - - # Space separated paths to include in the archive. - RELEASE_ADDS: README.md jobs: build: @@ -45,8 +39,9 @@ jobs: with: command: build args: --release --all-features --all --exclude mla-fuzz-afl --verbose ${{ matrix.cargo_build }} - - name: Run tests - run: cargo test --all --exclude mla-fuzz-afl --release --verbose + - name: Strip resulting binary + if: matrix.build == 'linux' + run: strip ./target/release/mlar${{ matrix.extension }} - name: Upload resulting 'mlar' uses: actions/upload-artifact@v1 with: @@ -73,48 +68,49 @@ jobs: with: tag_name: mlar-${{ steps.get_version.outputs.VERSION }} release_name: mlar-${{ steps.get_version.outputs.VERSION }} + draft: true - name: Download Linux artifact uses: actions/download-artifact@v1 with: name: mlar-linux + - name: Download Windows artifact + uses: actions/download-artifact@v1 + with: + name: mlar-windows + + - name: Download MacOS artifact + uses: actions/download-artifact@v1 + with: + name: mlar-macos + - name: Release Linux artifact uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./mlar + asset_path: ./mlar-linux asset_content_type: application/octet-stream asset_name: mlar-linux-static-${{ steps.get_version.outputs.VERSION }} - - name: Download Windows artifact - uses: actions/download-artifact@v1 - with: - name: mlar-windows - - name: Release Windows artifact uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./mlar.exe + asset_path: ./mlar-windows asset_content_type: application/octet-stream asset_name: mlar-windows-${{ steps.get_version.outputs.VERSION }} - - name: Download MacOS artifact - uses: actions/download-artifact@v1 - with: - name: mlar-macos - - name: Release MacOS artifact uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./mlar + asset_path: ./mlar-macos asset_content_type: application/octet-stream asset_name: mlar-macos-${{ steps.get_version.outputs.VERSION }} From c3359c3ec34a715fb5a2add3050f7717a546cfd8 Mon Sep 17 00:00:00 2001 From: Camille Mougey Date: Mon, 27 Jul 2020 11:19:34 +0200 Subject: [PATCH 3/5] Test3 --- .github/workflows/mlar_release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/mlar_release.yml b/.github/workflows/mlar_release.yml index 4226b14e..91a9d652 100644 --- a/.github/workflows/mlar_release.yml +++ b/.github/workflows/mlar_release.yml @@ -38,10 +38,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --all-features --all --exclude mla-fuzz-afl --verbose ${{ matrix.cargo_build }} - - name: Strip resulting binary - if: matrix.build == 'linux' - run: strip ./target/release/mlar${{ matrix.extension }} + args: --release --all-features --package mlar --verbose ${{ matrix.cargo_build }} - name: Upload resulting 'mlar' uses: actions/upload-artifact@v1 with: From 6addd0b46a8b62ae14b79e6e6cde151f88a18af0 Mon Sep 17 00:00:00 2001 From: Camille Mougey Date: Mon, 27 Jul 2020 11:23:48 +0200 Subject: [PATCH 4/5] Test3 --- .github/workflows/mlar_release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mlar_release.yml b/.github/workflows/mlar_release.yml index 91a9d652..8da4bf96 100644 --- a/.github/workflows/mlar_release.yml +++ b/.github/workflows/mlar_release.yml @@ -39,11 +39,14 @@ jobs: with: command: build args: --release --all-features --package mlar --verbose ${{ matrix.cargo_build }} + - name: Strip resulting binary + if: matrix.build == 'linux' + run: strip ./target/${{ matrix.target }}/release/mlar${{ matrix.extension }} - name: Upload resulting 'mlar' uses: actions/upload-artifact@v1 with: name: mlar-${{ matrix.build }} - path: ./target/release/mlar${{ matrix.extension }} + path: ./target/${{ matrix.target }}/release/mlar${{ matrix.extension }} release: # From https://github.com/cloudflare/wrangler/blob/master/.github/workflows/release.yml From ee7a71bb7900d2bd64d722c5b60b48e100e3c5b5 Mon Sep 17 00:00:00 2001 From: Camille Mougey Date: Mon, 27 Jul 2020 11:30:06 +0200 Subject: [PATCH 5/5] Test --- .github/workflows/mlar_release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mlar_release.yml b/.github/workflows/mlar_release.yml index 8da4bf96..8f963190 100644 --- a/.github/workflows/mlar_release.yml +++ b/.github/workflows/mlar_release.yml @@ -85,13 +85,16 @@ jobs: with: name: mlar-macos + - name: DEBUG + run: ls -ahl ./mlar-linux + - name: Release Linux artifact uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./mlar-linux + asset_path: ./mlar-linux/mlar asset_content_type: application/octet-stream asset_name: mlar-linux-static-${{ steps.get_version.outputs.VERSION }} @@ -101,7 +104,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./mlar-windows + asset_path: ./mlar-windows/mlar.exe asset_content_type: application/octet-stream asset_name: mlar-windows-${{ steps.get_version.outputs.VERSION }} @@ -111,6 +114,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./mlar-macos + asset_path: ./mlar-macos/mlar asset_content_type: application/octet-stream asset_name: mlar-macos-${{ steps.get_version.outputs.VERSION }}