Skip to content

Added task to build releases #16

Added task to build releases

Added task to build releases #16

Workflow file for this run

on:
release:
types: [created]
push:
tags:
- v[0-9]+.*
jobs:
release:
name: release ${{ matrix.target }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'release'
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
archive: tar.gz
os: ubuntu-latest
bin: rsvenv
name: rsvenv-x86_64-unknown-linux-musl.tar.gz
- target: aarch64-apple-darwin
archive: zip
os: macos-latest
bin: rsvenv
name: rsvenv-aarch64-apple-darwin.tar.gz
- target: x86_64-apple-darwin
archive: zip
os: macos-latest
bin: rsvenv
name: rsvenv-x86_64-apple-darwin.tar.gz
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.os, 'ubuntu')
- name: Build binary
shell: bash
run: |
cargo build --release --target ${{ matrix.target }}
if: ${{ !contains(matrix.os, 'windows') }}
- name: Strip binary
shell: bash
run: |
strip target/${{ matrix.target }}/release/${{ matrix.bin }}
- name: Package as archive
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../${{ matrix.name }} ${{ matrix.bin }}
cd -
- name: Publish release artifacts
uses: actions/upload-artifact@v3
with:
name: rsvenv-${{ matrix.target }}
path: "rsvenv*"
if: github.ref == 'refs/tags/test-release'
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
draft: true
files: "rsvenv*"
body_path: Changes.md
if: startsWith( github.ref, 'refs/tags/v' )