Commit a8e8013d28

a8e8013d280f815955ff95b426bb5185d6ffe544

parent: 2038e3f578

Unsigned

Pooya Moradi <pvonmoradi@gmail.com> · 2021-08-02 14:42 UTC

github: Replace workflow to directly upload to the repo Releases

Layout: unified · split

.github/workflows/release.yml +27 −11
@@ -1,27 +1,37 @@
1on: [push] 1on: [push, pull_request]
2 2
3name: build-test-release 3name: build-test-release
4 4
5jobs: 5jobs:
6 x86_64_glibc: 6 publish:
7 name: Ubuntu 18.04 (glibc) 7 name: Publish for ${{ matrix.os }}
8 runs-on: ubuntu-18.04 8 runs-on: ${{ matrix.os }}
9 strategy: 9 strategy:
10 matrix: 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 rust: 16 rust:
12 - stable 17 - stable
18 fail-fast: false
19
13 steps: 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 run: | 23 run: |
16 sudo apt update 24 sudo apt update
17 sudo apt install dirmngr gpg-agent apt-transport-https 25 sudo apt install dirmngr gpg-agent apt-transport-https
18 sudo apt-key adv --keyserver hkps://keys.openpgp.org --recv-keys 11E9DE8848F2B65222AA75B8D1820DB22A11534E 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 27 echo "deb https://weechat.org/ubuntu $(lsb_release -c | awk '{ print $NF }') 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 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 sudo apt update 29 sudo apt update
22 sudo apt install weechat-curses weechat-plugins weechat-python weechat-perl weechat-dev 30 sudo apt install weechat-curses weechat-plugins weechat-python weechat-perl weechat-dev
23 echo "version of weechat-plugin.h that weechat-sys uses by default:" 31 echo "version of weechat-plugin.h that weechat-sys uses by default:"
24 grep -m 1 -n -H "WEECHAT_PLUGIN_API_VERSION" "/usr/include/weechat/weechat-plugin.h" 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 - name: Checkout sources 36 - name: Checkout sources
27 uses: actions/checkout@v2 37 uses: actions/checkout@v2
@@ -44,8 +54,14 @@ jobs:
44 command: test 54 command: test
45 args: --release 55 args: --release
46 56
47 - name: Upload binary 57 - name: Upload binaries to release
48 uses: actions/upload-artifact@v2 58 uses: svenstaro/upload-release-action@v2
49 with: 59 with:
50 name: 'weechat-matrix-rs-x86_64-unknown-linux-gnu' 60 release_name: ${{ matrix.artifact_name }}
51 path: target/release/libmatrix.so 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`