release: 0.5.0 #9
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: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Release | |
jobs: | |
build: | |
name: Build Sources | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Build release binary | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --all-features --release | |
- name: Copy binary | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
mkdir -p ./dist | |
cp target/release/wait-for-them dist/wait-for-them-linux | |
- name: Copy binary | |
if: matrix.os == 'windows-latest' | |
run: | | |
mkdir -p ./dist | |
cp target/release/wait-for-them.exe dist/wait-for-them-windows.exe | |
- name: Copy binary | |
if: matrix.os == 'macos-latest' | |
run: | | |
mkdir -p ./dist | |
cp target/release/wait-for-them dist/wait-for-them-macos | |
- name: Build release binary (minimal) | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Copy binary (minimal) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
mkdir -p ./dist | |
cp target/release/wait-for-them dist/wait-for-them-linux-minimal | |
- name: Copy binary (minimal) | |
if: matrix.os == 'windows-latest' | |
run: | | |
cp target/release/wait-for-them.exe dist/wait-for-them-windows-minimal.exe | |
- name: Copy binary (minimal) | |
if: matrix.os == 'macos-latest' | |
run: | | |
mkdir -p ./dist | |
cp target/release/wait-for-them dist/wait-for-them-macos-minimal | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.os }} | |
path: ./dist | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: ['build'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Download artifacts ubuntu | |
uses: actions/download-artifact@v1 | |
with: | |
name: ubuntu-latest | |
path: dist | |
- name: Download artifacts windows | |
uses: actions/download-artifact@v1 | |
with: | |
name: windows-latest | |
path: dist | |
- name: Download artifacts macos | |
uses: actions/download-artifact@v1 | |
with: | |
name: macos-latest | |
path: dist | |
- name: Get description | |
run: echo "##[set-output name=tag_description;]$(git tag -l --format='%(contents:body)' ${{ github.ref }})" | |
id: get_description | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: "${{ steps.get_description.outputs.description }}" | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset ubuntu | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/wait-for-them-linux | |
asset_name: wait-for-them-linux | |
asset_content_type: application/bin | |
- name: Upload Release Asset ubuntu (minimal) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/wait-for-them-linux-minimal | |
asset_name: wait-for-them-linux-minimal | |
asset_content_type: application/bin | |
- name: Upload Release Asset windows | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/wait-for-them-windows.exe | |
asset_name: wait-for-them-windows.exe | |
asset_content_type: application/bin | |
- name: Upload Release Asset windows (minimal) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/wait-for-them-windows-minimal.exe | |
asset_name: wait-for-them-windows-minimal.exe | |
asset_content_type: application/bin | |
- name: Upload Release Asset macos | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/wait-for-them-macos | |
asset_name: wait-for-them-macos | |
asset_content_type: application/bin | |
- name: Upload Release Asset macos (minimal) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/wait-for-them-macos-minimal | |
asset_name: wait-for-them-macos-minimal | |
asset_content_type: application/bin |