From db2eccee2ee8d83d02d11ad6cc862a539f46dbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Fri, 21 May 2021 23:22:43 +0300 Subject: [PATCH 1/4] Removed #![feature(format_args_capture)], it was not used --- src/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c19200d..5a5890a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![feature(format_args_capture)] - mod click_info; mod click_mute; mod clicky_events; From f0fc0c7c2a185dd44c89dc8578d0c7c2b2e84175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Fri, 21 May 2021 22:51:24 +0300 Subject: [PATCH 2/4] Added GitHub action for building --- .github/workflows/build.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..52adde3 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,17 @@ +name: Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install build deps + run: sudo apt-get install libglvnd-dev libxi-dev libjack-jackd2-dev + - uses: actions-rs/toolchain@v1 + with: + # non-stable needed to use -Z unstable-options --config + toolchain: nightly + - run: 'cargo +nightly -Z unstable-options --config rustc-link-search=\"/usr/lib/x86_64-linux-gnu\" build' From b0d77f4423a910fc6bcab6626be1ed9bbadfa8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Sat, 22 May 2021 12:28:32 +0300 Subject: [PATCH 3/4] ci: Send results to Matrix --- .github/workflows/build.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 52adde3..cf72217 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,6 +7,13 @@ jobs: runs-on: ubuntu-latest steps: + - name: Build started notification + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "ClickMuteJack build started. [Progress.](https://github.com/eras/ClickMuteJack/actions/runs/${{github.run_id}})" + server: ${{ secrets.MATRIX_SERVER }} - uses: actions/checkout@v2 - name: Install build deps run: sudo apt-get install libglvnd-dev libxi-dev libjack-jackd2-dev @@ -15,3 +22,19 @@ jobs: # non-stable needed to use -Z unstable-options --config toolchain: nightly - run: 'cargo +nightly -Z unstable-options --config rustc-link-search=\"/usr/lib/x86_64-linux-gnu\" build' + - name: Build succeeded notification + if: ${{ success() }} + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "ClickMuteJack build complete. [Logs.](https://github.com/eras/ClickMuteJack/actions/runs/${{github.run_id}})" + server: ${{ secrets.MATRIX_SERVER }} + - name: Build failed notification + if: ${{ !success() }} + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "ClickMuteJack build failed. [Logs.](https://github.com/eras/ClickMuteJack/actions/runs/${{github.run_id}})" + server: ${{ secrets.MATRIX_SERVER }} From 58d0fedb60a7af48f15f9ecfacbab0e9fffc0060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Sat, 22 May 2021 13:14:48 +0300 Subject: [PATCH 4/4] Automate release building via tags Copied from memgrep basically. --- .github/workflows/tag.yaml | 84 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/tag.yaml diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml new file mode 100644 index 0000000..73312c9 --- /dev/null +++ b/.github/workflows/tag.yaml @@ -0,0 +1,84 @@ +on: + push: + tags: + - 'v*' + +name: tag +jobs: + build_and_test: + name: ClickMuteJack + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # https://stackoverflow.com/a/58178121 + - name: Set release information + id: vars + run: echo ::set-output name=git_describe::"$(git describe --tags)" + - name: Cancel if no tag + if: ${{ steps.vars.outputs.git_describe == '' }} + run: false + - name: Build started notification + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "ClickMuteJack release ${{ steps.vars.outputs.git_describe }} build started. [Progress.](https://github.com/eras/ClickMuteJack/actions/runs/${{github.run_id}})" + server: ${{ secrets.MATRIX_SERVER }} + - name: Install build deps + run: sudo apt-get install libglvnd-dev libxi-dev libjack-jackd2-dev + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + - name: Set annotated tag info information + id: vars2 + run: echo ::set-output name=git_message::"$(git tag -n999 -l $(git describe --tags))" + - name: build + env: + GIT_DESCRIBE: ${{ steps.vars.outputs.git_describe }} + run: 'cargo +nightly -Z unstable-options --config rustc-link-search=\"/usr/lib/x86_64-linux-gnu\" build --release' + - run: strip target/release/click_mute + - uses: actions/upload-artifact@v2 + with: + name: click-mute + path: | + target/release/click_mute + # https://github.com/actions/create-release + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: ${{ steps.vars2.outputs.git_message}} + draft: false + prerelease: false + # https://github.com/actions/upload-release-asset + - name: Upload Release Asset + id: upload_release_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/release/click_mute + asset_name: click-mute-${{ steps.vars.outputs.git_describe }}-linux-x86_64.bin + asset_content_type: application/octet-stream + - name: Build succeeded notification + if: ${{ success() }} + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "ClickMuteJack release ${{ steps.vars.outputs.git_describe }} build complete. [Logs.](https://github.com/eras/ClickMuteJack/actions/runs/${{github.run_id}})" + server: ${{ secrets.MATRIX_SERVER }} + - name: Build failed notification + if: ${{ !success() }} + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "ClickMuteJack release ${{ steps.vars.outputs.git_describe }} build failed. [Logs.](https://github.com/eras/ClickMuteJack/actions/runs/${{github.run_id}})" + server: ${{ secrets.MATRIX_SERVER }}