Skip to content

Commit

Permalink
Combine GH Action files
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubfijalkowski committed Jan 3, 2021
1 parent 29f10fe commit 7f69621
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 59 deletions.
73 changes: 72 additions & 1 deletion .github/workflows/ci.yaml
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:
Expand Down Expand Up @@ -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
58 changes: 0 additions & 58 deletions .github/workflows/release.yaml

This file was deleted.

0 comments on commit 7f69621

Please sign in to comment.