-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #9 Handles pushes, tagging, and sends Matrix messages.
- Loading branch information
Showing
3 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
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 | ||
- 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' | ||
- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![feature(format_args_capture)] | ||
|
||
mod click_info; | ||
mod click_mute; | ||
mod clicky_events; | ||
|