Bump #23
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-latest] | |
include: | |
- os: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
target_alias: linux-x86_64 | |
bin_suffix: '' | |
archive_suffix: '.tar.bz2' | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
target_alias: win-x86_64-msvc | |
bin_suffix: '.exe' | |
archive_suffix: '.zip' | |
defaults: | |
run: | |
shell: bash | |
env: | |
ARCHIVE_PATH: encrypted-dns_${{ github.ref_name }}_${{ matrix.target_alias }}${{ matrix.archive_suffix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mlugg/setup-zig@v1 | |
- uses: hecrj/setup-rust-action@v2 | |
with: | |
rust-version: stable | |
targets: ${{ matrix.target }} | |
- name: Check Cargo availability | |
run: cargo --version | |
- name: Check Rustup default toolchain | |
run: rustup default | grep stable | |
- name: Build | |
run: | | |
echo 'lto = "fat"' >> Cargo.toml | |
env RUSTFLAGS="-C strip=symbols" cargo build --release | |
mkdir encrypted-dns | |
cp target/release/encrypted-dns${{ matrix.bin_suffix }} encrypted-dns/ | |
cp README.md example-encrypted-dns.toml encrypted-dns/ | |
if [ "${{ matrix.os }}" = "ubuntu-20.04" ]; then | |
tar cjpf ${ARCHIVE_PATH} encrypted-dns | |
elif [ "${{ matrix.os }}" = "windows-latest" ]; then | |
"/C/Program Files/7-Zip/7z" a ${ARCHIVE_PATH} encrypted-dns | |
fi | |
- name: Install cargo-deb and build Debian package | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: | | |
cargo install cargo-deb | |
cargo deb --output=encrypted-dns_${{ github.ref_name }}_amd64.deb --no-build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: encrypted-dns_${{ matrix.target_alias }} | |
path: ${{ env.ARCHIVE_PATH }} | |
- uses: actions/upload-artifact@v4 | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
with: | |
name: encrypted-dns_deb-amd64 | |
path: encrypted-dns_${{ github.ref_name }}_amd64.deb | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: true | |
prerelease: false | |
files: | | |
encrypted-dns_deb-amd64/*.deb | |
encrypted-dns_linux-x86_64/*.tar.bz2 | |
encrypted-dns_win-x86_64-msvc/*.zip |