Skip to content

0.4.15

0.4.15 #73

Workflow file for this run

name: cli-release
on:
workflow_dispatch:
inputs:
tag:
description: release/tag to upload artifacts to
required: true
type: string
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
upload-compose-yaml:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Resolve inputs
id: resolve-inputs
# Use tag input if available, otherwise parse it out of the git ref
run: |
TAG_INPUT=${{ inputs.tag }}
echo "tag=${TAG_INPUT:-${GITHUB_REF/refs\/tags\//}}" >> $GITHUB_OUTPUT
- name: Publish
env:
GH_TOKEN: '${{ secrets.DIVVIUP_GITHUB_AUTOMATION_RELEASE_PAT }}'
run: |
gh release upload ${{ steps.resolve-inputs.outputs.tag }} compose.yaml
build-cli:
defaults:
run:
shell: bash
strategy:
matrix:
arch: ["x86_64", "aarch64"]
target: [
{
os: "ubuntu-latest",
triple-suffix: "unknown-linux-gnu",
extension: "",
extra-build-flags: ""
},
{
os: "windows-latest",
triple-suffix: "pc-windows-msvc",
extension: ".exe",
# Build with ring on Windows so we don't have to set up aws-lc-rs' toolchain
extra-build-flags: "--no-default-features --features ring,common"
},
{
os: "macos-latest",
triple-suffix: "apple-darwin",
extension: "",
extra-build-flags: ""
}
]
runs-on: ${{ matrix.target.os }}
steps:
- name: Resolve inputs
id: resolve-inputs
# Use tag input if available, otherwise parse it out of the git ref
run: |
TAG_INPUT=${{ inputs.tag }}
echo "tag=${TAG_INPUT:-${GITHUB_REF/refs\/tags\//}}" >> $GITHUB_OUTPUT
TRIPLE=`printf '%s-%s' ${{ matrix.arch }} ${{ matrix.target.triple-suffix }}`
echo "triple=$TRIPLE" >> $GITHUB_OUTPUT
EXECUTABLE=`printf 'divviup-%s%s' $TRIPLE ${{ matrix.target.extension }}`
echo "executable=$EXECUTABLE" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
target: ${{ steps.resolve-inputs.outputs.triple }}
args: ${{ format('--locked --release --package divviup-cli {0}', matrix.target.extra-build-flags) }}
strip: true
- name: Publish
env:
GH_TOKEN: '${{ secrets.DIVVIUP_GITHUB_AUTOMATION_RELEASE_PAT }}'
run: |
cp target/${{ steps.resolve-inputs.outputs.triple }}/release/divviup${{ matrix.target.extension }} \
./${{ steps.resolve-inputs.outputs.executable }}
gh release upload \
${{ steps.resolve-inputs.outputs.tag }} ${{ steps.resolve-inputs.outputs.executable }}