Skip to content

Commit

Permalink
fix: 修复编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Sep 8, 2023
1 parent 1184578 commit c209afd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,32 @@ on:
jobs:
meta:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set_tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: set_tag
run: |
echo tag=$(git describe --tags --match "v*" ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT
is_release=${{ startsWith(github.ref, 'refs/tags/v') }}
tag=$(git describe --tags --match "v*" ${{ github.ref }} || true)
if [[ $tag != v* ]]; then
tag=$(curl -sX GET "https://api.github.com/repos/MaaAssistantArknights/MaaFramework/releases/latest" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | awk '/tag_name/{print $4}' FS='["]')
if [[ $tag != v* ]]; then
tag="v0.0.0"
fi
tag=$(date "+$tag-%y%m%d-$(git rev-parse --short HEAD)")
fi
if ! $($is_release) ; then
prefix=${tag%-*-*}
suffix=${tag#$prefix-}
tag="$prefix-ci.$suffix"
fi
echo tag=$tag | tee -a $GITHUB_OUTPUT
echo is_release=$is_release | tee -a $GITHUB_OUTPUT
outputs:
tag: ${{ steps.set_tag.outputs.tag }}
is_release: ${{ steps.set_tag.outputs.is_release }}

windows:
needs: meta
Expand Down Expand Up @@ -213,8 +232,8 @@ jobs:
path: "install"

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [meta, windows]
if: ${{ needs.meta.outputs.is_release == 'true' }}
needs: [meta, windows, ubuntu, macos]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions source/cli/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <cstdio>
#include <filesystem>
#include <fstream>
#include <iostream>
Expand Down

0 comments on commit c209afd

Please sign in to comment.