Fix release build (1)

feature/lookup-installed
trivernis 2 years ago
parent 980e9afb8b
commit 05802d8d4c
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -6,21 +6,39 @@ on:
workflow_dispatch:
jobs:
build-release:
create-release-draft:
name: pre-release
runs-on: ubuntu-latest
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v1
- uses: actions/checkout@v2
if: ${{ !env.ACT }}
- id: create_release
uses: marvinpinto/action-automatic-releases@latest
if: ${{ !env.ACT }}
with:
platform: x64
- name: Cache cargo builds
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
draft: true
title: Latest Pre-Release
files: |
LICENSE
build-release:
needs: create-release-draft
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
if: ${{ !env.ACT }}
- name: Cache build data
if: ${{ !env.ACT }}
uses: actions/cache@v2
with:
path: |
@ -29,24 +47,21 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build Release
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --all-features -Zmultitarget --target x86_64-unknown-linux-gnu --target x86_64-pc-windows-gnu
- name: Move binaries
run: mv target/x86_64-unknown-linux-gnu/release/nenv target/nenv-linux-x86_64 && mv target/x86_64-pc-windows-gnu/release/nenv.exe target/nenv-windows-x86_64.exe
- name: Upload artifacts
uses: actions/upload-artifact@v2
- name: Build
run: cargo build --release
- uses: vimtor/action-zip@v1
with:
name: nenv
path: target/nenv*
- name: publish release
uses: "marvinpinto/action-automatic-releases@latest"
files: target/release/nenv*
dest: nenv-${{ runner.os }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE
target/nenv*
upload_url: ${{ needs.create-release-draft.outputs.release_upload_url }}
asset_path: ./nenv-${{ runner.os }}.zip
asset_name: nenv-${{ runner.os }}.zip
asset_content_type: application/zip
Loading…
Cancel
Save