diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 0000000..daf7246 --- /dev/null +++ b/.github/workflows/releases.yml @@ -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 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 31000a2..510f3df 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 diff --git a/timeline.zip b/timeline.zip deleted file mode 100644 index 3da3efa..0000000 Binary files a/timeline.zip and /dev/null differ