Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP feat: Add github actions workflow #5

Merged
merged 20 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update: github build config.
  • Loading branch information
sauravhiremath committed Apr 28, 2020
commit 32dd643adcaf64d846ce6d6c336a9877b9ed0194
42 changes: 14 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,30 @@ jobs:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
rust:
node:
- stable
- beta
- nightly
- lts
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all

- name: Upload Artifact (Linux/MacOS)
uses: actions/upload-artifact@v1
if: matrix.rust == 'stable' && matrix.os != 'windows-latest'
if: matrix.os != 'windows-latest'
with:
name: juno-${{matrix.os}}
path: target/release/juno

- name: Upload Artifact (Windows)
uses: actions/upload-artifact@v1
if: matrix.rust == 'stable' && matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest'
with:
name: juno-${{matrix.os}}
path: target/release/juno.exe

release-master: # Publish release on push to master
# Publish release on push to master
release-master:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
Expand All @@ -61,10 +47,10 @@ jobs:
- name: Check Release Version
uses: thebongy/version-check@v1
with:
file: Cargo.toml
file: package.json
tagFormat: v${version}
id: version_check

- name: Download Windows Artifact
uses: actions/download-artifact@v1
with:
Expand All @@ -82,7 +68,7 @@ jobs:
with:
name: juno-ubuntu-latest
path: release/linux

- name: Rename Artifacts
run: |
mv release/windows/juno.exe release/windows/juno-${{steps.version_check.outputs.releaseVersion}}-windows.exe
Expand Down Expand Up @@ -110,10 +96,10 @@ jobs:
- name: Check Release Version
uses: thebongy/version-check@v1
with:
file: Cargo.toml
file: package.json
tagFormat: v${version}-beta
id: version_check

- name: Download Windows Artifact
uses: actions/download-artifact@v1
with:
Expand All @@ -131,7 +117,7 @@ jobs:
with:
name: juno-ubuntu-latest
path: release/linux

- name: Rename Artifacts
run: |
mv release/windows/juno.exe release/windows/juno-${{steps.version_check.outputs.releaseVersion}}-windows.exe
Expand All @@ -146,4 +132,4 @@ jobs:
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

8 changes: 5 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ on:
branches:
- master
- staging
- develop
- develop

name: Continuous integration (PR)

jobs:
version-check:
if: github.base_ref == 'staging' || github.base_ref == 'master'
Expand All @@ -21,7 +23,7 @@ jobs:
file: package.json
tagFormat: v${version}-beta
id: version_check_staging

- name: Check Release Version (master)
if: github.base_ref == 'master'
uses: thebongy/version-check@v1
Expand All @@ -45,7 +47,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: npm ci

- name: Publish to npm
uses: actions-rs/cargo@v1
with:
Expand Down