Skip to content

Rename

Rename #72

Workflow file for this run

name: Rust
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
name: build ${{ matrix.file }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
file:
# - ${{ github.event.repository.name }}
- bin1
- bin2
runs-on: ${{ matrix.os }}
# outputs:
# artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
env:
NAME: ${{ format('target/release/{0}{1}', matrix.file, startsWith(matrix.os, 'windows') && '.exe' || '') }}
NEW_NAME: target/release/${{ matrix.file }}-${{ github.ref_name }}-${{ matrix.os }}${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
ARTIFACT_NAME: Binary-${{ matrix.file }}-${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Build
env:
CARGO_TERM_COLOR: always
run: cargo build --release --verbose
- name: Rename files
shell: bash
run: mv $NAME $NEW_NAME
- name: Upload
uses: actions/upload-artifact@master
id: artifact-upload-step
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.NEW_NAME }}
# - name: Output artifact URL
# run: echo 'Artifact URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}'
release:
name: downloading Binary-${{ matrix.file }}-${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
file:
# - ${{ github.event.repository.name }}
- bin1
- bin2
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
env:
ARTIFACT_NAME: Binary-${{ matrix.file }}-${{ matrix.os }}
steps:
- uses: actions/download-artifact@master
with:
name: ${{ env.ARTIFACT_NAME }}
- name: List files
run: |
ls -lih
- name: GH Release for ${{ matrix.os }}
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: '*'
- name: Done
run: |
echo "### [${{ github.ref_name }}](https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ github.ref_name }}) Released! :rocket:" >> $GITHUB_STEP_SUMMARY