diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..285c86d --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,65 @@ +name: Build Releases +on: + watch: + types: started + repository_dispatch: + types: build + +permissions: + contents: write + +env: + CARGO_TERM_COLOR: always + +jobs: + build-cross: + runs-on: ubuntu-latest + env: + RUST_BACKTRACE: full + strategy: + fail-fast: false + matrix: + target: + - mips-unknown-linux-musl + - mipsel-unknown-linux-musl + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + run: | + bash <(curl --proto '=https' --tlsv1.2 -sS ${{ secrets.rustup }}) ${{ matrix.target }} + + - name: Install cross + run: cargo install cross + + - name: Build ${{ matrix.target }} + timeout-minutes: 120 + run: | + git clone https://github.com/shadowsocks/shadowsocks-rust + cd shadowsocks-rust + shadowsocks_version="$(git describe --tags `git rev-list --tags --max-count=1`)" + echo shadowsocks_version="$shadowsocks_version" >> "$GITHUB_ENV" + git checkout $(git describe --tags `git rev-list --tags --max-count=1`) + cd build + ./build-release -t ${{ matrix.target }} -f 'local-redir,local-tun' + cd release + sha256sum shadowsocks-$shadowsocks_version.${{ matrix.target }}.tar.xz > shadowsocks-$shadowsocks_version.${{ matrix.target }}.tar.xz.sha256 + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: shadowsocks-${{ env.shadowsocks_version }}.${{ matrix.target }} + path: shadowsocks-rust/build/release/shadowsocks-${{ env.shadowsocks_version }}.${{ matrix.target }}.tar.xz + + - name: Create release + continue-on-error: true + uses: ncipollo/release-action@v1 + with: + name: ${{ env.shadowsocks_version }} + allowUpdates: true + replacesArtifacts: true + commit: main + tag: ${{ env.shadowsocks_version }} + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: shadowsocks-rust/build/release/shadowsocks-${{ env.shadowsocks_version }}.${{ matrix.target }}.tar.xz,shadowsocks-rust/build/release/shadowsocks-${{ env.shadowsocks_version }}.${{ matrix.target }}.tar.xz.sha256 diff --git a/README.md b/README.md new file mode 100644 index 0000000..6e203ad --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# shadowsocks-rust for mips/mipsel