|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
|
|
|
name: Release
|
|
|
|
|
|
|
|
env:
|
|
|
|
RELEASE_SDB: skyd
|
|
|
|
RELEASE_SKYSH: skysh
|
|
|
|
RELEASE_BENCH: sky-bench
|
|
|
|
RELEASE_DIR: artifacts
|
|
|
|
GITHUB_REF: "${{ github.ref }}"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_64bit:
|
|
|
|
name: Build artifacts (64-bit)
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build: [linux, macos, windows]
|
|
|
|
include:
|
|
|
|
- build: linux
|
|
|
|
os: ubuntu-latest
|
|
|
|
artifact: x86_64-linux-gnu
|
|
|
|
- build: macos
|
|
|
|
os: macos-latest
|
|
|
|
artifact: x86_64-macos
|
|
|
|
- build: windows
|
|
|
|
os: windows-latest
|
|
|
|
artifact: x86_64-windows
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache Cargo registry
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
key: ${{ matrix.build }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.build }}-cargo-registry-
|
|
|
|
|
|
|
|
- name: Cache Cargo index
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
|
|
|
key: ${{ matrix.build }}-cargo-index-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.build }}-cargo-index-
|
|
|
|
|
|
|
|
- name: Cache Cargo build
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
key: ${{ matrix.build }}-target-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.build }}-target-
|
|
|
|
|
|
|
|
- name: Query version number
|
|
|
|
id: get_version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "using version tag ${GITHUB_REF:10}"
|
|
|
|
echo ::set-output name=version::"${GITHUB_REF:10}"
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
run: |
|
|
|
|
rustup update ${{ matrix.rust }} --no-self-update
|
|
|
|
rustup default ${{ matrix.rust }}
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
run: cargo build --release
|
|
|
|
|
|
|
|
- name: Build (Windows)
|
|
|
|
shell: cmd # Use cmd as the default shell to avoid perl path errors
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: cargo build --release
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: -Ctarget-feature=+crt-static
|
|
|
|
|
|
|
|
- name: Upload binaries
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact }}
|
|
|
|
path: |
|
|
|
|
target/release/skyd
|
|
|
|
target/release/skysh
|
|
|
|
target/release/sky-bench
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Upload binaries (Windows)
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact }}
|
|
|
|
path: |
|
|
|
|
target/release/skyd.exe
|
|
|
|
target/release/skysh.exe
|
|
|
|
target/release/sky-bench.exe
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
build_32bit:
|
|
|
|
name: Build artifacts (32-bit)
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build: [linux, windows]
|
|
|
|
include:
|
|
|
|
- build: linux
|
|
|
|
os: ubuntu-latest
|
|
|
|
rust: i686-unknown-linux-gnu
|
|
|
|
artifact: i686-linux-gnu
|
|
|
|
- build: windows
|
|
|
|
os: windows-latest
|
|
|
|
artifact: i686-windows
|
|
|
|
rust: i686-pc-windows-msvc
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache Cargo registry
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.rust }}-cargo-registry-
|
|
|
|
|
|
|
|
- name: Cache Cargo index
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
|
|
|
key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.rust }}-cargo-index-
|
|
|
|
|
|
|
|
- name: Cache Cargo build
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.rust }}-target-
|
|
|
|
|
|
|
|
- name: Query version number
|
|
|
|
id: get_version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "using version tag ${GITHUB_REF:10}"
|
|
|
|
echo ::set-output name=version::"${GITHUB_REF:10}"
|
|
|
|
|
|
|
|
- name: Install 32-bit tools (Linux)
|
|
|
|
run: |
|
|
|
|
sudo apt update && sudo apt install gcc-multilib -y
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
run: |
|
|
|
|
rustup target add ${{ matrix.rust }}
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
run: cargo build --release
|
|
|
|
|
|
|
|
- name: Build (Windows)
|
|
|
|
shell: cmd # Use cmd as the default shell to avoid perl path errors
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: cargo build --release
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: -Ctarget-feature=+crt-static
|
|
|
|
|
|
|
|
- name: Upload binaries
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact }}
|
|
|
|
path: |
|
|
|
|
target/release/skyd
|
|
|
|
target/release/skysh
|
|
|
|
target/release/sky-bench
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Upload binaries (Windows)
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact }}
|
|
|
|
path: |
|
|
|
|
target/release/skyd.exe
|
|
|
|
target/release/skysh.exe
|
|
|
|
target/release/sky-bench.exe
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: Release Tier 1
|
|
|
|
needs:
|
|
|
|
- build_64bit
|
|
|
|
- build_32bit
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Query version number
|
|
|
|
id: get_version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "using version tag ${GITHUB_REF:10}"
|
|
|
|
echo ::set-output name=version::"${GITHUB_REF:10}"
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.TDBB }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
|
|
|
release_name: ${{ steps.get_version.outputs.VERSION }}
|
|
|
|
prerelease: true
|
|
|
|
|
|
|
|
- name: Download all artifacts
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
path: artifacts
|
|
|
|
|
|
|
|
- name: Archive artifacts
|
|
|
|
run: |
|
|
|
|
chmod +x ci/artifact.sh
|
|
|
|
bash ci/artifact.sh
|
|
|
|
|
|
|
|
- name: Release Linux bundle (x86_64)
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.TDBB }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: artifacts/x86_64-linux-gnu.zip
|
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-x86_64-linux-gnu.zip
|
|
|
|
|
|
|
|
- name: Release Windows bundle (x86_64)
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.TDBB }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: artifacts/x86_64-windows.zip
|
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-x86_64-windows.zip
|
|
|
|
|
|
|
|
- name: Release MacOS bundle (x86_64)
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.TDBB }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: artifacts/x86_64-macos.zip
|
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-x86_64-macos.zip
|
|
|
|
|
|
|
|
- name: Release Linux bundle (i686)
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.TDBB }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: artifacts/i686-linux-gnu.zip
|
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-i686-linux-gnu.zip
|
|
|
|
|
|
|
|
- name: Release Windows bundle (i686)
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.TDBB }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: artifacts/i686-windows.zip
|
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-i686-windows.zip
|