From 99e2ca5f616378ef55ea119167c91dedeea4baff Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Tue, 12 Sep 2023 18:59:31 +0200 Subject: [PATCH] ci: add release CD Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- .github/workflows/release-cd.yml | 118 +++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 .github/workflows/release-cd.yml diff --git a/.github/workflows/release-cd.yml b/.github/workflows/release-cd.yml new file mode 100644 index 0000000..ea79164 --- /dev/null +++ b/.github/workflows/release-cd.yml @@ -0,0 +1,118 @@ +name: Build release binaries + +on: + push: + branches: + - release/* + +env: + BINARY_NAME: rustic-scheduler + +jobs: + publish: + name: Publishing ${{ matrix.job.target }} + runs-on: ${{ matrix.job.os }} + strategy: + matrix: + rust: [stable] + job: + - os: windows-latest + os-name: windows + target: x86_64-pc-windows-msvc + architecture: x86_64 + binary-postfix: ".exe" + use-cross: false + - os: macos-latest + os-name: macos + target: x86_64-apple-darwin + architecture: x86_64 + binary-postfix: "" + use-cross: false + - os: macos-latest + os-name: macos + target: aarch64-apple-darwin + architecture: arm64 + binary-postfix: "" + use-cross: true + - os: ubuntu-latest + os-name: linux + target: x86_64-unknown-linux-gnu + architecture: x86_64 + binary-postfix: "" + use-cross: false + - os: ubuntu-latest + os-name: linux + target: x86_64-unknown-linux-musl + architecture: x86_64 + binary-postfix: "" + use-cross: false + - os: ubuntu-latest + os-name: linux + target: aarch64-unknown-linux-gnu + architecture: arm64 + binary-postfix: "" + use-cross: true + - os: ubuntu-latest + os-name: linux + target: i686-unknown-linux-gnu + architecture: i686 + binary-postfix: "" + use-cross: true + - os: ubuntu-latest + os-name: netbsd + target: x86_64-unknown-netbsd + architecture: x86_64 + binary-postfix: "" + use-cross: true + - os: ubuntu-latest + os-name: linux + target: armv7-unknown-linux-gnueabihf + architecture: armv7 + binary-postfix: "" + use-cross: true + + steps: + - name: Checkout repository + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + with: + fetch-depth: 0 # fetch all history so that git describe works + - name: Create binary artifact + uses: rustic-rs/create-binary-artifact@main # dev + with: + toolchain: ${{ matrix.rust }} + target: ${{ matrix.job.target }} + use-cross: ${{ matrix.job.use-cross }} + describe-tag-suffix: "" + binary-postfix: ${{ matrix.job.binary-postfix }} + os: ${{ runner.os }} + binary-name: ${{ env.BINARY_NAME }} + package-secondary-name: ${{ matrix.job.target}} + github-token: ${{ secrets.GITHUB_TOKEN }} + gpg-release-private-key: ${{ secrets.GPG_RELEASE_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + github-ref: ${{ github.ref }} + sign-release: true + hash-release: true + use-project-version: false # not being used in rustic_server +# +# TODO!: add publishing to release draft +# TODO!: include changelog in release draft +# +# publish-cargo: +# name: Publishing to Cargo +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true +# - uses: Swatinem/rust-cache@v2 +# with: +# key: ${{ matrix.job.target }} +# - uses: actions-rs/cargo@v1 +# with: +# command: publish +# args: --token ${{ secrets.CARGO_API_KEY }}