|
|
@ -6,21 +6,39 @@ on:
|
|
|
|
workflow_dispatch:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
build-release:
|
|
|
|
create-release-draft:
|
|
|
|
|
|
|
|
name: pre-release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
|
|
|
|
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
- name: Set up toolchain
|
|
|
|
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
- id: create_release
|
|
|
|
with:
|
|
|
|
uses: marvinpinto/action-automatic-releases@latest
|
|
|
|
toolchain: nightly
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Set up MinGW
|
|
|
|
|
|
|
|
uses: egor-tensin/setup-mingw@v1
|
|
|
|
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
platform: x64
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Cache cargo builds
|
|
|
|
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
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
path: |
|
|
|
@ -29,24 +47,21 @@ jobs:
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-cargo-
|
|
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Build Release
|
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
run: cargo build --release
|
|
|
|
with:
|
|
|
|
|
|
|
|
use-cross: false
|
|
|
|
- uses: vimtor/action-zip@v1
|
|
|
|
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
|
|
|
|
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
name: nenv
|
|
|
|
files: target/release/nenv*
|
|
|
|
path: target/nenv*
|
|
|
|
dest: nenv-${{ runner.os }}.zip
|
|
|
|
- name: publish release
|
|
|
|
|
|
|
|
uses: "marvinpinto/action-automatic-releases@latest"
|
|
|
|
- name: Upload Release Asset
|
|
|
|
|
|
|
|
id: upload-release-asset
|
|
|
|
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
upload_url: ${{ needs.create-release-draft.outputs.release_upload_url }}
|
|
|
|
prerelease: false
|
|
|
|
asset_path: ./nenv-${{ runner.os }}.zip
|
|
|
|
files: |
|
|
|
|
asset_name: nenv-${{ runner.os }}.zip
|
|
|
|
LICENSE
|
|
|
|
asset_content_type: application/zip
|
|
|
|
target/nenv*
|
|
|
|
|