test release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/release.yml | ||
name: release | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
jobs: | ||
build-release: | ||
name: build-release | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
build: [linux-x86_64, macos-x86_64, windows-x86_64-gnu] | ||
include: | ||
- build: linux-x86_64 | ||
os: ubuntu-latest | ||
rust: nightly | ||
target: x86_64-unknown-linux-gnu | ||
- build: macos-x86_64 | ||
os: macos-latest | ||
rust: nightly | ||
target: x86_64-apple-darwin | ||
- build: windows-x86_64-gnu | ||
os: windows-latest | ||
rust: nightly-x86_64-gnu | ||
target: x86_64-pc-windows-gnu | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Run build | ||
- name: install rustup | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh | ||
sh rustup-init.sh -y --default-toolchain none | ||
rustup target add ${{ matrix.target }} | ||
- name: Add mingw64 to path for x86_64-gnu | ||
run: | | ||
pacman -Sy mingw-w64-x86_64-cmake | ||
pacman -Sy mingw-w64-x86_64-ninja | ||
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH | ||
if: matrix.rust == 'nightly-x86_64-gnu' | ||
shell: bash | ||
- name: Build release binaries | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target ${{matrix.target}} --verbose | ||
- name: build acts-cli | ||
run: cargo build --release --target ${{matrix.target}} -p acts-cli --verbose | ||
- name: Build archive | ||
shell: bash | ||
run: | | ||
staging="${{ matrix.build }}" | ||
mkdir -p "$staging" | ||
cp {README.md,LICENSE,acts.conf} "$staging/" | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
cp target/${{matrix.target}}/release/acts-server.exe "$staging/" | ||
cp target/${{matrix.target}}/release/acts-cli.exe "$staging/" | ||
7z a "$staging.zip" "$staging" | ||
echo "ASSET=$staging.zip" >> $GITHUB_ENV | ||
else | ||
cp target/${{matrix.target}}/release/acts-server "$staging/" | ||
cp target/${{matrix.target}}/release/acts-cli "$staging/" | ||
tar czf "$staging.tar.gz" "$staging" | ||
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | ||
fi | ||
- name: Upload Release Asset | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, '0.5.1') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ${{ env.ASSET }} |