dumb-downloader/.github/workflows/build-version.yaml
2023-03-24 15:39:47 +01:00

62 lines
1.4 KiB
YAML

---
name: "Version build"
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features --target=${{ matrix.target }}
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: build-${{matrix.target}}
path: ${{ github.workspace }}/target/${{ matrix.target }}/release/dudo
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
- name: Set version variable
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Rename release to avoid name conflict
run: ./scripts/rename_releases.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
files: release/*