first try yml by chatgpt
This commit is contained in:
parent
5b69d5bfbe
commit
2849b29627
1 changed files with 44 additions and 3 deletions
47
.github/workflows/publish.yml
vendored
47
.github/workflows/publish.yml
vendored
|
|
@ -7,12 +7,20 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
name: ${{ matrix.os }}
|
name: ${{ matrix.name }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: linux
|
- name: Windows
|
||||||
|
os: windows-latest
|
||||||
|
artifact_name: target/release/caesar.exe
|
||||||
|
asset_name: caesar-windows
|
||||||
|
- name: MacOS
|
||||||
|
os: macos-latest
|
||||||
|
artifact_name: target/release/caesar
|
||||||
|
asset_name: caesar-macos
|
||||||
|
- name: Linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
artifact_name: target/release/caesar
|
artifact_name: target/release/caesar
|
||||||
asset_name: caesar-linux
|
asset_name: caesar-linux
|
||||||
|
|
@ -21,12 +29,23 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps on MacOS
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
run: brew install protobuf
|
||||||
|
|
||||||
|
- name: Install deps on Windows
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: choco install protobuf
|
||||||
|
|
||||||
|
- name: Install deps on Linux
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: sudo apt-get -y install protobuf-compiler
|
run: sudo apt-get -y install protobuf-compiler
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --locked
|
run: cargo build --release --locked
|
||||||
|
|
@ -36,3 +55,25 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.asset_name }}
|
name: ${{ matrix.asset_name }}
|
||||||
path: ${{ matrix.artifact_name }}
|
path: ${{ matrix.artifact_name }}
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
body: 'Release of ${{ github.ref }}'
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ${{ steps.upload_binaries.outputs.path }}
|
||||||
|
asset_name: ${{ matrix.asset_name }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue