obsidian-export/.github/workflows/release.yml
dependabot[bot] 7a3f278e4b Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 15:41:06 +01:00

126 lines
3.3 KiB
YAML

on:
push:
tags:
- "v*"
name: Create release
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 }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
build-linux:
name: Linux binary
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked
- run: strip target/release/obsidian-export
- uses: actions/upload-artifact@v3
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
asset_name: obsidian-export_Linux-x86_64.bin
asset_content_type: application/octet-stream
build-windows:
name: Windows binary
needs: create-release
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked
- run: strip target/release/obsidian-export.exe
- uses: actions/upload-artifact@v3
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
asset_name: obsidian-export_Windows-x64_64.exe
asset_content_type: application/octet-stream
build-macos:
name: Mac OS binary
needs: create-release
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked
- run: strip target/release/obsidian-export
- uses: actions/upload-artifact@v3
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
asset_name: obsidian-export_MacOS-x86_64.bin
asset_content_type: application/octet-stream