Skip to content

Commit

Permalink
Merge pull request #4 from bkrmendy/github-action-windows-macos
Browse files Browse the repository at this point in the history
build on windows and macos
  • Loading branch information
bkrmendy authored Feb 9, 2024
2 parents d9b8e9c + d1faaf0 commit 1c18037
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 10 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose
- name: Build
run: cargo build --verbose --release
- name: copy build artifact to zip file
shell: powershell
working-directory: ${{ github.workspace }}
run: |
cp .\target\release\timeline.dll .\timeline\timeline.dll
Compress-Archive .\timeline\ timeline.zip -u
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: timeline-win-x86_64
path: timeline.zip
compression-level: 0

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose
- name: Build
run: cargo build --verbose --release
- name: copy build artifact to zip file
working-directory: ${{ github.workspace }}
run: |
cp ./target/release/libtimeline.dylib ./timeline/libtimeline.dylib
zip -r timeline.zip ./timeline
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: timeline-macos-x86_64
path: timeline.zip
compression-level: 0

do-release:
runs-on: ubuntu-latest
needs: [build-windows, build-macos]
steps:
- name: Download Windows Build
uses: actions/download-artifact@v3
with:
name: timeline-win-x86_64
path: timeline-win-x86_64.zip
- name: Download MacOS Build
uses: actions/download-artifact@v3
with:
name: timeline-macos-x86_64
path: timeline-macos-x86_64.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
timeline-macos-x86_64.zip
timeline-win-x86_64.zip
23 changes: 13 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose
Binary file removed timeline.zip
Binary file not shown.

0 comments on commit 1c18037

Please sign in to comment.