-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29f10fe
commit 7f69621
Showing
2 changed files
with
72 additions
and
59 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
on: [push, pull_request] | ||
|
||
name: Build | ||
name: Build & Release | ||
|
||
jobs: | ||
check: | ||
|
@@ -80,3 +80,74 @@ jobs: | |
KVENV_CLIENT_SECRET: ${{ secrets.KVENV_CLIENT_SECRET }} | ||
KVENV_KEYVAULT_NAME: ${{ secrets.KVENV_KEYVAULT_NAME }} | ||
KVENV_SECRET_NAME: ${{ secrets.KVENV_SECRET_NAME }} | ||
|
||
release: | ||
name: Create Github Release | ||
if: contains(github.ref, 'tags/v') | ||
needs: [check, fmt, clippy, test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
- name: Output Release URL File | ||
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | ||
- name: Save Release URL File for publish | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: release_url | ||
path: release_url.txt | ||
|
||
publish: | ||
name: Upload binaries | ||
if: contains(github.ref, 'tags/v') | ||
needs: [check, fmt, clippy, test, release] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-gnu | ||
- x86_64-unknown-linux-musl | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: ${{ matrix.target }} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
name: Build | ||
with: | ||
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} | ||
command: build | ||
args: --release --target ${{ matrix.target }} | ||
- name: Load Release URL File from release job | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: release_url | ||
- name: Get Release File Name & Upload URL | ||
id: get_release_info | ||
run: | | ||
value=`cat release_url/release_url.txt` | ||
echo ::set-output name=upload_url::$value | ||
env: | ||
TAG_REF_NAME: ${{ github.ref }} | ||
REPOSITORY_NAME: ${{ github.repository }} | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ./target/${{ matrix.target }}/release/kvenv | ||
asset_name: kvenv-${{ matrix.target }} | ||
asset_content_type: application/octet-stream |
This file was deleted.
Oops, something went wrong.