Workflows: build improvements, release

ci/github-actions
German Lashevich 5 years ago
parent 6f358399d0
commit a8bd624839
No known key found for this signature in database
GPG Key ID: 3446FAE369C9A8B4

@ -1,4 +1,4 @@
name: Rust
name: build
on: [push]
@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Install latest stable
@ -21,9 +21,10 @@ jobs:
uses: actions/cache@v1
with:
path: target
key: ${{ runner.OS }}-target-${{ github.ref }}
key: ${{ runner.OS }}-target-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-target-master
${{ runner.OS }}-target-${{ github.ref }}-
${{ runner.OS }}-target-master-
${{ runner.OS }}-target-
- name: Build
run: cargo build --verbose

@ -0,0 +1,25 @@
name: release
on:
push:
tags:
- '*'
jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

@ -0,0 +1,46 @@
name: upload-release-assets
on:
release:
types: [created]
jobs:
assets:
name: Build and upload release assets
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Install latest stable rust toolchain
if: matrix.os == 'macos-latest'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/checkout@v1
name: Checkout code
- name: Restore cache
uses: actions/cache@v1
with:
path: target
key: ${{ runner.OS }}-target-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-target-${{ github.ref }}-
${{ runner.OS }}-target-master-
${{ runner.OS }}-target-
- name: Build release
run: cargo build --release
- name: Upload release asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.assets_url }}
asset_path: target/release/totp
asset_name: totp-${{ runner.OS }}
asset_content_type: application/octet-stream

@ -1,6 +1,6 @@
# 🐴 RusTOTPony
![](https://github.com/zebradil/rustotpony/workflows/Rust/badge.svg)
![](https://github.com/zebradil/rustotpony/workflows/build/badge.svg)
[![Build Status](https://travis-ci.org/Zebradil/rustotpony.svg?branch=master)](https://travis-ci.org/Zebradil/rustotpony)
[![Build status](https://ci.appveyor.com/api/projects/status/rx68dv1kjepslelh/branch/master?svg=true)](https://ci.appveyor.com/project/Zebradil/rustotpony/branch/master)

Loading…
Cancel
Save