Added user input validation #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-gnu | |
archive: tar.gz | |
os: ubuntu-latest | |
bin: rsvenv | |
name: rsvenv-x86_64-unknown-linux-gnu.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@v4 | |
- 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: | | |
rustup target add ${{ matrix.target }} | |
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@v4 | |
with: | |
name: rsvenv-${{ matrix.target }} | |
path: "rsvenv*" | |
if: github.ref == 'refs/tags/test-release' | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: "rsvenv*" | |
body_path: Changes.md | |
if: startsWith( github.ref, 'refs/tags/v' ) | |