Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gokberkkocak authored Apr 22, 2021
1 parent 95fc4a5 commit 1653e73
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Create Release Builds

on:
push:
tags:
- "v*" # matches v1.0.1, v1.2, v2, etc

env:
CARGO_TERM_COLOR: always

jobs:
once:
name: Create GitHub release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create a 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 }}
draft: true
prerelease: true

build:
name: Create cross-platform release build, tag and upload binaries
needs: once
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build release version
run: cargo build --release
- name: Make Zip
run:
7z a -tzip ${{ github.workspace }}/target/release/rrr-${{ matrix.os }}.zip ${{ github.workspace }}/target/release/rrr* "-x!*.d" "-x!*.pdb"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.once.outputs.upload_url }}
asset_path: ${{ github.workspace }}/target/release/rrr-${{ matrix.os }}.zip
asset_name: rrr-${{ matrix.os }}.zip
asset_content_type: application/octet-stream

0 comments on commit 1653e73

Please sign in to comment.