Skip to content

Commit

Permalink
Add GitHub actions for PRs and release (#1)
Browse files Browse the repository at this point in the history
* Add GitHub actions for PRs and release
  • Loading branch information
Szymongib authored Jun 20, 2020
1 parent 2978a78 commit 1ebb1db
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create Release Artifacts
on:
release:
types:
- created
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
include:
- os: macos-latest
TARGET: x86_64-apple-darwin
- os: ubuntu-latest
TARGET: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v1
- run: echo ${{matrix.TARGET}}
- name: Build Artifacts
run: cargo build --verbose --release --target ${{matrix.TARGET}}
- name: Rename Artifacts
run: mv ./target/${{matrix.TARGET}}/release/bookmark bookmark-${{matrix.TARGET}}
- name: Get Upload URL
run: |
UPLOAD_URL=$(jq --raw-output '.release.upload_url' "$GITHUB_EVENT_PATH")
echo ::set-env name=UPLOAD_URL::$UPLOAD_URL
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: bookmark-${{matrix.TARGET}}
asset_name: bookmark-${{matrix.TARGET}}
asset_content_type: application/octet-stream
18 changes: 18 additions & 0 deletions .github/workflows/rust-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build And Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Run Tests
run: cargo test --verbose
- name: Build
run: cargo build --verbose --release

0 comments on commit 1ebb1db

Please sign in to comment.