Skip to content

Commit

Permalink
Add release support to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Felipe Dominguez Vega committed Aug 6, 2020
1 parent 0bddb3b commit 609b58b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D clippy::all -D clippy::pedantic -D warnings
args: -- -D clippy::all -D warnings
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and upload binaries to release

on:
push:
tags: ["v*"]

jobs:
create_release:
runs-on: ubuntu-latest
steps:
- 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 }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_assets:
needs: create_release
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: rustyping
asset_name: rustyping-linux-x64.tar.gz
- os: macos-latest
artifact_name: rustyping
asset_name: rustyping-darwin-x64.tar.gz
runs-on: ${{ matrix.os }}
steps:
- name: checkout the source code
uses: actions/checkout@v2
- name: build (release)
run: cargo build --verbose --release
- name: compress
uses: master-atul/[email protected]
with:
command: c
cwd: ./target/release
files: |
${{ matrix.artifact_name }}
outPath: ./target/release/${{ matrix.asset_name }}
- name: upload release assets
id: upload-release-assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./target/release/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/tar+gzip
20 changes: 0 additions & 20 deletions .github/workflows/rust.yml

This file was deleted.

0 comments on commit 609b58b

Please sign in to comment.