|
| 1 | +on: |
| 2 | + push: |
| 3 | + # Sequence of patterns matched against refs/tags |
| 4 | + tags: |
| 5 | + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 6 | + |
| 7 | +name: Mean Bean Deploy |
| 8 | +env: |
| 9 | + BIN: autojump |
| 10 | + |
| 11 | +jobs: |
| 12 | + # This job downloads and stores `cross` as an artifact, so that it can be |
| 13 | + # redownloaded across all of the jobs. Currently this copied pasted between |
| 14 | + # `mean_bean_ci.yml` and `mean_bean_deploy.yml`. Make sure to update both places when making |
| 15 | + # changes. |
| 16 | + install-cross: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v1 |
| 20 | + with: |
| 21 | + depth: 50 |
| 22 | + - uses: XAMPPRocky/get-github-release@v1 |
| 23 | + id: cross |
| 24 | + with: |
| 25 | + owner: cross-rs |
| 26 | + repo: cross |
| 27 | + matches: ${{ matrix.platform }} |
| 28 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + - uses: actions/upload-artifact@v1 |
| 30 | + with: |
| 31 | + name: cross-${{ matrix.platform }} |
| 32 | + path: ${{ steps.cross.outputs.install_path }} |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + platform: [linux-musl, apple-darwin] |
| 36 | + |
| 37 | + windows: |
| 38 | + runs-on: windows-latest |
| 39 | + needs: install-cross |
| 40 | + strategy: |
| 41 | + matrix: |
| 42 | + target: |
| 43 | + # MSVC |
| 44 | + - i686-pc-windows-msvc |
| 45 | + - x86_64-pc-windows-msvc |
| 46 | + # GNU |
| 47 | + # - i686-pc-windows-gnu |
| 48 | + # - x86_64-pc-windows-gnu |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v2 |
| 51 | + - run: bash ci/set_rust_version.bash stable ${{ matrix.target }} |
| 52 | + - run: bash ci/build.bash cargo ${{ matrix.target }} RELEASE |
| 53 | + - run: | |
| 54 | + cd ./target/${{ matrix.target }}/release/ |
| 55 | + 7z a "${{ env.BIN }}.zip" "${{ env.BIN }}.exe" |
| 56 | + mv "${{ env.BIN }}.zip" $GITHUB_WORKSPACE |
| 57 | + shell: bash |
| 58 | + # We're using using a fork of `actions/create-release` that detects |
| 59 | + # whether a release is already available or not first. |
| 60 | + - uses: XAMPPRocky/create-release@v1.0.2 |
| 61 | + id: create_release |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + with: |
| 65 | + tag_name: ${{ github.ref }} |
| 66 | + release_name: ${{ github.ref }} |
| 67 | + # Draft should **always** be false. GitHub doesn't provide a way to |
| 68 | + # get draft releases from its API, so there's no point using it. |
| 69 | + draft: false |
| 70 | + prerelease: false |
| 71 | + - uses: actions/upload-release-asset@v1 |
| 72 | + id: upload-release-asset |
| 73 | + env: |
| 74 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + with: |
| 76 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 77 | + asset_path: ${{ env.BIN }}.zip |
| 78 | + asset_name: ${{ env.BIN }}-${{ matrix.target }}.zip |
| 79 | + asset_content_type: application/zip |
| 80 | + |
| 81 | + macos: |
| 82 | + runs-on: macos-latest |
| 83 | + needs: install-cross |
| 84 | + strategy: |
| 85 | + matrix: |
| 86 | + target: |
| 87 | + # macOS |
| 88 | + - aarch64-apple-darwin |
| 89 | + - x86_64-apple-darwin |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@v2 |
| 92 | + - uses: actions/download-artifact@v1 |
| 93 | + with: |
| 94 | + name: cross-apple-darwin |
| 95 | + path: /usr/local/bin/ |
| 96 | + - run: chmod +x /usr/local/bin/cross |
| 97 | + |
| 98 | + - run: ci/set_rust_version.bash stable ${{ matrix.target }} |
| 99 | + - run: ci/build.bash cross ${{ matrix.target }} RELEASE |
| 100 | + - run: tar -czvf ${{ env.BIN }}.tar.gz --directory=target/${{ matrix.target }}/release ${{ env.BIN }} |
| 101 | + - uses: XAMPPRocky/create-release@v1.0.2 |
| 102 | + id: create_release |
| 103 | + env: |
| 104 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 105 | + with: |
| 106 | + tag_name: ${{ github.ref }} |
| 107 | + release_name: ${{ github.ref }} |
| 108 | + draft: false |
| 109 | + prerelease: false |
| 110 | + - uses: actions/upload-release-asset@v1 |
| 111 | + id: upload-release-asset |
| 112 | + env: |
| 113 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + with: |
| 115 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 116 | + asset_path: ${{ env.BIN }}.tar.gz |
| 117 | + asset_name: ${{ env.BIN }}-${{ matrix.target }}.tar.gz |
| 118 | + asset_content_type: application/gzip |
| 119 | + |
| 120 | + linux: |
| 121 | + runs-on: ubuntu-latest |
| 122 | + needs: install-cross |
| 123 | + strategy: |
| 124 | + matrix: |
| 125 | + target: |
| 126 | + # Linux |
| 127 | + - aarch64-unknown-linux-musl |
| 128 | + - arm-unknown-linux-musleabi |
| 129 | + - armv7-unknown-linux-musleabihf |
| 130 | + - i686-unknown-linux-musl |
| 131 | + - mips-unknown-linux-musl |
| 132 | + - mips64-unknown-linux-muslabi64 |
| 133 | + - mips64el-unknown-linux-muslabi64 |
| 134 | + - mipsel-unknown-linux-musl |
| 135 | + - powerpc-unknown-linux-gnu |
| 136 | + - powerpc64-unknown-linux-gnu |
| 137 | + - powerpc64le-unknown-linux-gnu |
| 138 | + - s390x-unknown-linux-gnu |
| 139 | + - x86_64-unknown-linux-musl |
| 140 | + # Android |
| 141 | + - aarch64-linux-android |
| 142 | + - arm-linux-androideabi |
| 143 | + - armv7-linux-androideabi |
| 144 | + - i686-linux-android |
| 145 | + - x86_64-linux-android |
| 146 | + # *BSD |
| 147 | + # The FreeBSD targets can have issues linking so they are disabled |
| 148 | + # by default. |
| 149 | + # - i686-unknown-freebsd |
| 150 | + # - x86_64-unknown-freebsd |
| 151 | + - x86_64-unknown-netbsd |
| 152 | + # Solaris |
| 153 | + - sparcv9-sun-solaris |
| 154 | + - x86_64-sun-solaris |
| 155 | + # Bare Metal |
| 156 | + # These are no-std embedded targets, so they will only build if your |
| 157 | + # crate is `no_std` compatible. |
| 158 | + # - thumbv6m-none-eabi |
| 159 | + # - thumbv7em-none-eabi |
| 160 | + # - thumbv7em-none-eabihf |
| 161 | + # - thumbv7m-none-eabi |
| 162 | + steps: |
| 163 | + - uses: actions/checkout@v2 |
| 164 | + - uses: actions/download-artifact@v1 |
| 165 | + with: |
| 166 | + name: cross-linux-musl |
| 167 | + path: /tmp/ |
| 168 | + - run: chmod +x /tmp/cross |
| 169 | + |
| 170 | + - run: ci/set_rust_version.bash stable ${{ matrix.target }} |
| 171 | + - run: ci/build.bash /tmp/cross ${{ matrix.target }} RELEASE |
| 172 | + - run: tar -czvf ${{ env.BIN }}.tar.gz --directory=target/${{ matrix.target }}/release ${{ env.BIN }} |
| 173 | + - uses: XAMPPRocky/create-release@v1.0.2 |
| 174 | + id: create_release |
| 175 | + env: |
| 176 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 177 | + with: |
| 178 | + tag_name: ${{ github.ref }} |
| 179 | + release_name: ${{ github.ref }} |
| 180 | + draft: false |
| 181 | + prerelease: false |
| 182 | + - name: Upload Release Asset |
| 183 | + id: upload-release-asset |
| 184 | + uses: actions/upload-release-asset@v1 |
| 185 | + env: |
| 186 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 187 | + with: |
| 188 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 189 | + asset_path: ${{ env.BIN }}.tar.gz |
| 190 | + asset_name: ${{ env.BIN }}-${{ matrix.target }}.tar.gz |
| 191 | + asset_content_type: application/gzip |
0 commit comments