Skip to content

Commit

Permalink
Merge branch 'master' into json
Browse files Browse the repository at this point in the history
  • Loading branch information
L3nn0x authored Jun 13, 2021
2 parents 974243d + 094a552 commit c556fd2
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Rust

on: [push]

env:
CARGO_TERM_COLOR: always
RELEASE_TAG: idl-latest

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get processor arch
run: echo "PROCESSOR_ARCH=`uname -p`" >> $GITHUB_ENV
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Prepare Release
run: tar --transform 's/.*\///g' -zcvf ${{github.workspace}}/${{ runner.os }}-${{ env.PROCESSOR_ARCH }}-packet_generator.tar.gz target/*/packet_generator
- name: Upload linux build
uses: actions/upload-artifact@v2
with:
name: linux_build
path: ${{github.workspace}}/${{ runner.os }}-${{ env.PROCESSOR_ARCH }}-packet_generator.tar.gz
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Prepare Release
run: |
copy-item ${{github.workspace}}\target\release\packet_generator.exe -destination ${{github.workspace}}\packet_generator.exe
7z a ${{github.workspace}}/windows-amd64-packet_generator.zip ${{github.workspace}}\packet_generator.exe
- name: Upload windows build
uses: actions/upload-artifact@v2
with:
name: windows_build
path: ${{github.workspace}}/windows-amd64-packet_generator.zip

release:
runs-on: ubuntu-latest
needs: [linux, windows]
if: github.ref == 'refs/heads/master'
steps:
- name: Download linux build
uses: actions/download-artifact@v2
with:
name: linux_build
- name: Download windows build
uses: actions/download-artifact@v2
with:
name: windows_build
- name: Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
replacesArtifacts: true
body: latest packet_generator build
artifacts: "*-packet_generator.tar.gz,*-packet_generator.zip"
tag: ${{env.RELEASE_TAG}}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c556fd2

Please sign in to comment.