-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions for PRs and release (#1)
* Add GitHub actions for PRs and release
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |