fork/static-web-server
git clone https://git.julia.blue/fork/static-web-server
1c4929d
allow-symlink
1name : release-build-manual 2on : 3pull_request : 4types : 5- labeled 6 7jobs : 8build : 9name : build 10environment : release-build-manual 11if : contains(github.event.label.name, 'release:manual:v2.') 12runs-on : ${{ matrix.os }} 13env : 14# For some builds, we use cross to test on 32-bit and big-endian 15# systems. 16CARGO_BIN : cargo 17# When CARGO_BIN is set to CROSS, this is set to `--target matrix.target`. 18TARGET_FLAGS : "" 19# When CARGO_BIN is set to CROSS, TARGET_DIR includes matrix.target. 20TARGET_DIR : ./target 21# Emit backtraces on panics. 22RUST_BACKTRACE : 1 23# Rustc flags needed by the `all` features 24RUSTFLAGS : "--cfg tokio_unstable" 25# SWS features for Cargo build 26CARGO_FEATURES : "--features=all" 27strategy : 28matrix : 29build : 30- windows-msvc-arm64 31include : 32# - build: linux-musl 33# os: ubuntu-22.04 34# rust: stable 35# target: x86_64-unknown-linux-musl 36# - build: linux-musl-i686 37# os: ubuntu-22.04 38# rust: stable 39# target: i686-unknown-linux-musl 40# - build: linux-musl-arm64 41# os: ubuntu-22.04 42# rust: stable 43# target: aarch64-unknown-linux-musl 44# - build: linux-gnu 45# os: ubuntu-22.04 46# rust: stable 47# target: x86_64-unknown-linux-gnu 48# - build: linux-gnu-i686 49# os: ubuntu-22.04 50# rust: stable 51# target: i686-unknown-linux-gnu 52# - build: linux-gnu-arm64 53# os: ubuntu-22.04 54# rust: stable 55# target: aarch64-unknown-linux-gnu 56# - build: linux-arm-gnueabihf 57# os: ubuntu-22.04 58# rust: stable 59# target: arm-unknown-linux-gnueabihf 60# - build: linux-musl-armv6 61# os: ubuntu-22.04 62# rust: stable 63# target: arm-unknown-linux-musleabihf 64# - build: linux-musl-armv7 65# os: ubuntu-22.04 66# rust: stable 67# target: armv7-unknown-linux-musleabihf 68# - build: linux-ppc64le 69# os: ubuntu-22.04 70# rust: stable 71# target: powerpc64le-unknown-linux-gnu 72# - build: linux-s390x 73# os: ubuntu-22.04 74# rust: stable 75# target: s390x-unknown-linux-gnu 76# # - build: linux-android-armv7 77# # os: ubuntu-22.04 78# # rust: stable 79# # target: armv7-linux-androideabi 80# - build: linux-android-arm64 81# os: ubuntu-22.04 82# rust: stable 83# target: aarch64-linux-android 84# - build: netbsd 85# os: ubuntu-22.04 86# rust: stable 87# target: x86_64-unknown-netbsd 88# - build: illumos 89# os: ubuntu-22.04 90# rust: stable 91# target: x86_64-unknown-illumos 92# - build: macos 93# os: macos-14 94# rust: stable 95# target: x86_64-apple-darwin 96# - build: macos-arm64 97# os: macos-14 98# rust: stable 99# target: aarch64-apple-darwin 100- build : windows-msvc 101os : windows-2022 102rust : stable 103target : x86_64-pc-windows-msvc 104- build : windows-msvc-i686 105os : windows-2022 106rust : stable 107target : i686-pc-windows-msvc 108- build : windows-msvc-arm64 109os : windows-2022 110rust : stable 111target : aarch64-pc-windows-msvc 112# - build: windows-pc-gnu 113# os: windows-2022 114# rust: stable-x86_64-gnu 115# target: x86_64-pc-windows-gnu 116 117steps : 118- name : Checkout repository 119uses : actions/checkout@v4 120with : 121fetch-depth : 1 122 123- name : Install Linux/BSD tools 124if : ${{ !contains(matrix.os, 'windows') }} 125run : scripts/ci/install_tools.sh --target=${{ matrix.target }} 126 127- name : Install Rust 128uses : dtolnay/rust-toolchain@stable 129with : 130toolchain : ${{ matrix.rust }} 131target : ${{ matrix.target }} 132 133- name : Set up Cross 134shell : bash 135run : | 136if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then 137# Use 'cargo.sh' script for Android targets only 138if [[ "${{ matrix.build }}" == "linux-android-armv7" ]] || [[ "${{ matrix.build }}" == "linux-android-arm64" ]]; then 139echo "CARGO_BIN=scripts/ci/cargo.sh" >> $GITHUB_ENV 140else 141cargo install cross@^0.2 142echo "CARGO_BIN=cross" >> $GITHUB_ENV 143fi 144fi 145echo "TARGET_FLAGS=--target=${{ matrix.target }}" >> $GITHUB_ENV 146echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV 147 148- name : Setup Windows ARM64 149if : ${{ contains(matrix.build, 'windows-msvc-arm64') }} 150run : | 151# ring crate: add Visual Studio Build Tools "VS 2022 C++ ARM64 build tools" and "clang" components 152$env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin" 153 154- name : Show command used for Cargo 155run : | 156echo "cargo command is: ${{ env.CARGO_BIN }}" 157echo "target flag is: ${{ env.TARGET_FLAGS }}" 158echo "target dir is: ${{ env.TARGET_DIR }}" 159 160- name : Build release binary 161run : ${{ env.CARGO_BIN }} build --bin static-web-server -vv --release ${{ env.CARGO_FEATURES }} ${{ env.TARGET_FLAGS }} 162 163- name : Prepare Docker envs 164shell : bash 165run : | 166version=${{ github.event.label.name }} 167semver=${version#*release:manual:v} 168echo "SEMVER=$semver" >> $GITHUB_ENV 169echo "SEMVER_MAJOR=${semver%.*.*}" >> $GITHUB_ENV 170echo "SEMVER_MINOR=${semver%.*}" >> $GITHUB_ENV 171 172- name : Build archive 173shell : bash 174run : | 175staging="static-web-server-${{ env.SEMVER }}-${{ matrix.target }}" 176mkdir -p "$staging/" 177mkdir -p bin 178 179cp {README.md,LICENSE-APACHE,LICENSE-MIT} "$staging/" 180 181if [ "${{ matrix.os }}" = "windows-2022" ]; then 182cp "target/${{ matrix.target }}/release/static-web-server.exe" "$staging/" 1837z a "$staging.zip" "$staging" 184echo "ASSET=$staging.zip" >> $GITHUB_ENV 185else 186# The man page is only generated on Unix systems. 187cp "target/${{ matrix.target }}/release/static-web-server" "$staging/" 188cp "$staging/static-web-server" bin/ 189tar czf "$staging.tar.gz" "$staging" 190echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV 191fi 192 193- name : Upload release archive 194uses : actions/upload-release-asset@v1.0.1 195env : 196GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 197with : 198upload_url : ${{ secrets.RELEASE_UPLOAD_URL }} 199asset_path : ${{ env.ASSET }} 200asset_name : ${{ env.ASSET }} 201asset_content_type : application/octet-stream