fix(build): test fix for github workflow

This commit is contained in:
Patryk Hegenberg 2024-05-02 21:35:40 +02:00
parent 42e4a63a6a
commit 6162e6ac58

View file

@ -3,7 +3,7 @@ name: Build and Publish
on: on:
push: push:
tags: tags:
- '*' - "*"
jobs: jobs:
publish: publish:
@ -14,66 +14,67 @@ jobs:
include: include:
- name: Windows - name: Windows
os: windows-latest os: windows-latest
artifact_name: target/release/caesar.exe artifact_name: caesar.exe
asset_name: caesar-windows asset_name: caesar-windows.exe
- name: MacOS - name: MacOS
os: macos-latest os: macos-latest
artifact_name: target/release/caesar artifact_name: caesar
asset_name: caesar-macos asset_name: caesar-macos
- name: Linux - name: Linux
os: ubuntu-latest os: ubuntu-latest
artifact_name: target/release/caesar artifact_name: caesar
asset_name: caesar-linux asset_name: caesar-linux
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install deps on MacOS - name: Install deps on MacOS
if: matrix.os == 'macos-latest' if: matrix.os == 'macos-latest'
run: brew install protobuf run: brew install protobuf
- name: Install deps on Windows - name: Install deps on Windows
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: choco install protobuf run: choco install protobuf
- name: Install deps on Linux - name: Install deps on Linux
if: matrix.os == 'ubuntu-latest' 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 profile: minimal
override: true override: true
- name: Build - name: Build
run: cargo build --release --locked run: cargo build --release --locked
- name: Upload binaries to release - name: Upload binaries to release
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: ${{ matrix.asset_name }} name: ${{ matrix.asset_name }}
path: ${{ matrix.artifact_name }} path: target/release/${{ matrix.artifact_name }}
- name: Create Release - name: Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') id: create_release
uses: actions/create-release@v1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env: uses: actions/create-release@v1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} env:
with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref }} with:
release_name: Release ${{ github.ref }} tag_name: ${{ github.ref }}
draft: false release_name: Release ${{ github.ref }}
prerelease: false draft: false
body: 'Release of ${{ github.ref }}' prerelease: false
body: "Release of ${{ github.ref }}"
- name: Upload Release Asset - name: Upload Release Asset
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.upload_binaries.outputs.path }} asset_path: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }} asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream asset_content_type: application/octet-stream