Commit a8e8013d28
Unsigned
Layout: unified · split
.github/workflows/release.yml +27 −11
| @@ -1,27 +1,37 @@ | ||
| 1 | on: [push] | |
| 1 | on: [push, pull_request] | |
| 2 | 2 | |
| 3 | 3 | name: build-test-release |
| 4 | 4 | |
| 5 | 5 | jobs: |
| 6 | x86_64_glibc: | |
| 7 | name: Ubuntu 18.04 (glibc) | |
| 8 | runs-on: ubuntu-18.04 | |
| 6 | publish: | |
| 7 | name: Publish for ${{ matrix.os }} | |
| 8 | runs-on: ${{ matrix.os }} | |
| 9 | 9 | strategy: |
| 10 | 10 | matrix: |
| 11 | os: [ubuntu-18.04] | |
| 12 | include: | |
| 13 | - os: ubuntu-18.04 | |
| 14 | artifact_name: libmatrix.so | |
| 15 | asset_name: libmatrix.so-ubuntu-18.04 | |
| 11 | 16 | rust: |
| 12 | 17 | - stable |
| 18 | fail-fast: false | |
| 19 | ||
| 13 | 20 | steps: |
| 14 | - name: Install latest-stable weechat for Ubuntu 18.04 | |
| 21 | - name: Install latest-stable weechat for Ubuntu | |
| 22 | id: build_env | |
| 15 | 23 | run: | |
| 16 | 24 | sudo apt update |
| 17 | 25 | sudo apt install dirmngr gpg-agent apt-transport-https |
| 18 | 26 | sudo apt-key adv --keyserver hkps://keys.openpgp.org --recv-keys 11E9DE8848F2B65222AA75B8D1820DB22A11534E |
| 19 | echo "deb https://weechat.org/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/weechat.list | |
| 20 | echo "deb-src https://weechat.org/ubuntu bionic main" | sudo tee -a /etc/apt/sources.list.d/weechat.list | |
| 27 | echo "deb https://weechat.org/ubuntu $(lsb_release -c | awk '{ print $NF }') main" | sudo tee /etc/apt/sources.list.d/weechat.list | |
| 28 | echo "deb-src https://weechat.org/ubuntu $(lsb_release -c | awk '{ print $NF }') main" | sudo tee -a /etc/apt/sources.list.d/weechat.list | |
| 21 | 29 | sudo apt update |
| 22 | 30 | sudo apt install weechat-curses weechat-plugins weechat-python weechat-perl weechat-dev |
| 23 | 31 | echo "version of weechat-plugin.h that weechat-sys uses by default:" |
| 24 | 32 | grep -m 1 -n -H "WEECHAT_PLUGIN_API_VERSION" "/usr/include/weechat/weechat-plugin.h" |
| 33 | v="$(grep -m 1 -o 'WEECHAT_PLUGIN_API_VERSION.*' '/usr/include/weechat/weechat-plugin.h')" | |
| 34 | echo "::set-output name=W_API_V::$v" | |
| 25 | 35 | |
| 26 | 36 | - name: Checkout sources |
| 27 | 37 | uses: actions/checkout@v2 |
| @@ -44,8 +54,14 @@ jobs: | ||
| 44 | 54 | command: test |
| 45 | 55 | args: --release |
| 46 | 56 | |
| 47 | - name: Upload binary | |
| 48 | uses: actions/upload-artifact@v2 | |
| 57 | - name: Upload binaries to release | |
| 58 | uses: svenstaro/upload-release-action@v2 | |
| 49 | 59 | with: |
| 50 | name: 'weechat-matrix-rs-x86_64-unknown-linux-gnu' | |
| 51 | path: target/release/libmatrix.so | |
| 60 | release_name: ${{ matrix.artifact_name }} | |
| 61 | repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| 62 | file: target/release/${{ matrix.artifact_name }} | |
| 63 | asset_name: ${{ matrix.asset_name }} | |
| 64 | tag: ${{ github.ref }} | |
| 65 | overwrite: true | |
| 66 | prerelease: true | |
| 67 | body: Unstable binary for `${{ matrix.os }}` built against `${{ steps.build_env.outputs.W_API_V }}`. Rename it to `matrix.so` and put it inside `$WEECHAT_HOME/plugins` | |