2023-09-23 14:22:00 +03:00
|
|
|
name: Create release
|
2020-11-28 15:14:50 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
2023-09-23 14:22:00 +03:00
|
|
|
env:
|
|
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
RUSTC_WRAPPER: "sccache"
|
2020-11-28 15:14:50 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
create-release:
|
|
|
|
name: Create release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
upload_url: "${{ steps.create_release.outputs.upload_url }}"
|
|
|
|
steps:
|
|
|
|
- id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
2021-02-15 23:26:10 +03:00
|
|
|
release_name: ${{ github.ref }}
|
2020-11-28 15:14:50 +03:00
|
|
|
draft: true
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
build-linux:
|
|
|
|
name: Linux binary
|
|
|
|
needs: create-release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-23 10:38:42 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-23 14:22:00 +03:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
id: setup_rust
|
|
|
|
- uses: actions/cache@v3
|
2020-11-28 15:14:50 +03:00
|
|
|
with:
|
2023-09-23 14:22:00 +03:00
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: "cargo-build-linux-${{ steps.setup_rust.outputs.cachekey }}"
|
|
|
|
- name: Run sccache-cache
|
|
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
|
|
|
|
|
|
|
- run: cargo build --release --locked
|
2020-11-28 15:14:50 +03:00
|
|
|
- run: strip target/release/obsidian-export
|
|
|
|
|
2022-05-01 22:01:03 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-11-28 15:14:50 +03:00
|
|
|
with:
|
|
|
|
name: Linux binary
|
|
|
|
path: target/release/obsidian-export
|
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
- uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
|
|
asset_path: target/release/obsidian-export
|
2022-01-02 14:08:50 +03:00
|
|
|
asset_name: obsidian-export_Linux-x86_64.bin
|
2020-11-28 15:14:50 +03:00
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
|
|
|
|
build-windows:
|
|
|
|
name: Windows binary
|
|
|
|
needs: create-release
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2023-09-23 10:38:42 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-23 14:22:00 +03:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
id: setup_rust
|
|
|
|
- uses: actions/cache@v3
|
2020-11-28 15:14:50 +03:00
|
|
|
with:
|
2023-09-23 14:22:00 +03:00
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: "cargo-build-linux-${{ steps.setup_rust.outputs.cachekey }}"
|
|
|
|
- name: Run sccache-cache
|
|
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
|
|
|
|
|
|
|
- run: cargo build --release --locked
|
2020-11-28 15:14:50 +03:00
|
|
|
- run: strip target/release/obsidian-export.exe
|
|
|
|
|
2022-05-01 22:01:03 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-11-28 15:14:50 +03:00
|
|
|
with:
|
|
|
|
name: Windows binary
|
|
|
|
path: target/release/obsidian-export.exe
|
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
- uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
|
|
asset_path: target/release/obsidian-export.exe
|
2022-01-02 14:08:50 +03:00
|
|
|
asset_name: obsidian-export_Windows-x64_64.exe
|
2020-11-28 15:14:50 +03:00
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
|
|
|
|
build-macos:
|
|
|
|
name: Mac OS binary
|
|
|
|
needs: create-release
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2023-09-23 10:38:42 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-23 14:22:00 +03:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
id: setup_rust
|
|
|
|
- uses: actions/cache@v3
|
2020-11-28 15:14:50 +03:00
|
|
|
with:
|
2023-09-23 14:22:00 +03:00
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: "cargo-build-linux-${{ steps.setup_rust.outputs.cachekey }}"
|
|
|
|
- name: Run sccache-cache
|
|
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
|
|
|
|
|
|
|
- run: cargo build --release --locked
|
2020-11-28 15:14:50 +03:00
|
|
|
- run: strip target/release/obsidian-export
|
|
|
|
|
2022-05-01 22:01:03 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-11-28 15:14:50 +03:00
|
|
|
with:
|
|
|
|
name: MacOS binary
|
|
|
|
path: target/release/obsidian-export
|
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
- uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
|
|
asset_path: target/release/obsidian-export
|
2022-01-02 14:08:50 +03:00
|
|
|
asset_name: obsidian-export_MacOS-x86_64.bin
|
2020-11-28 15:14:50 +03:00
|
|
|
asset_content_type: application/octet-stream
|