Skip to content

chore: specify rust 1.71 #42

chore: specify rust 1.71

chore: specify rust 1.71 #42

Workflow file for this run

name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
release:
name: Cross build for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
exe: rathole
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
exe: rathole
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
exe: rathole
- os: ubuntu-latest
target: arm-unknown-linux-musleabi
exe: rathole
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
exe: rathole
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
exe: rathole
- os: ubuntu-latest
target: mips-unknown-linux-gnu
exe: rathole
- os: ubuntu-latest
target: mips-unknown-linux-musl
exe: rathole
- os: ubuntu-latest
target: mipsel-unknown-linux-gnu
exe: rathole
- os: ubuntu-latest
target: mipsel-unknown-linux-musl
exe: rathole
- os: ubuntu-latest
target: mips64-unknown-linux-gnuabi64
exe: rathole
- os: ubuntu-latest
target: mips64el-unknown-linux-gnuabi64
exe: rathole
- os: macos-latest
target: x86_64-apple-darwin
exe: rathole
- os: windows-latest
target: x86_64-pc-windows-msvc
exe: rathole.exe
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71
default: true
- name: Install cross
run: cargo install --version 0.2.5 cross
- name: Use Compile Features For Embedded
if: contains(matrix.target, 'mips') || contains(matrix.target, 'arm')
run: echo "RATHOLE_FEATURES=embedded" >> $GITHUB_ENV
- name: Run tests
run: cross test --release --target ${{ matrix.target }} --verbose --features ${RATHOLE_FEATURES:-default}
- name: Build release
run: cross build --release --target ${{ matrix.target }} --features ${RATHOLE_FEATURES:-default}
- name: Run UPX
# Upx may not support some platforms. Ignore the errors
continue-on-error: true
# Disable upx for mips. See https://github.com/upx/upx/issues/387
if: matrix.os == 'ubuntu-latest' && !contains(matrix.target, 'mips')
uses: crazy-max/ghaction-upx@v1
with:
version: v4.0.2
files: target/${{ matrix.target }}/release/${{ matrix.exe }}
args: -q --best --lzma
- uses: actions/upload-artifact@v2
with:
name: rathole-${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ matrix.exe }}
- name: Zip Release
uses: TheDoctor0/[email protected]
with:
type: zip
filename: rathole-${{ matrix.target }}.zip
directory: target/${{ matrix.target }}/release/
path: ${{ matrix.exe }}
- name: Publish
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/${{ matrix.target }}/release/rathole-${{ matrix.target }}.zip
generate_release_notes: true
draft: true
docker:
name: Publish to Docker Hub
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: release
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: rapiz1/rathole:latest, rapiz1/rathole:${{ github.ref_name }}
publish-crate:
name: Publish to crates.io
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
run: cargo publish