Skip to content

Rework the CI

Rework the CI #82

Workflow file for this run

name: Build Release
on:
push:
tags:
- v*
branches:
- test-release/*
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- id: version
run: echo "version=${ref##test-release/}" >> $GITHUB_OUTPUT
env:
ref: ${{ github.ref_name }}
build-releases:
name: Build release
runs-on: ubuntu-latest
needs: get-version
strategy:
matrix:
platform:
- target: x86_64-unknown-linux-gnu
arch: x86_64
- target: aarch64-unknown-linux-gnu
arch: aarch64
- target: armv7-unknown-linux-gnueabihf
arch: armv7h
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install -y gettext binutils
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.platform.target }}
override: true
- run: cargo install cross
- name: Build Paru
run: ./scripts/dist
env:
CARGO_BUILD_TARGET: ${{ matrix.platform.target }}
- uses: actions/upload-artifact@v2
with:
name: paru-${{ needs.get-version.outputs.version }}-${{ matrix.platform.arch }}.tar.zst
path: paru-${{ matrix.platform.arch }}.tar.zst
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build-releases, get-version]
outputs:
release-url: ${{ steps.create-release.outputs.url }}
steps:
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.get-version.outputs.version }}
release_name: Paru v${{ needs.get-version.outputs.version }}
draft: true
prerelease: false
upload-binaries:
name: Upload binaries to Githib relase
runs-on: ubuntu-latest
needs: [release, get-version]
strategy:
matrix:
arch: [x86_64, aarch64, armv7h]
steps:
- uses: actions/download-artifact@v3
with:
path: paru-${{ needs.get-version.outputs.version }}-${{ matrix.arch }}.tar.zstd
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.release-url }}
asset_path: paru-${{ needs.get-version.outputs.version }}-${{ matrix.arch }}.tar.ztd
asset_content_type: application/tar+zstd