daily-automatic-update #172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: daily-automatic-update | |
on: | |
schedule: | |
- cron: "0 17 * * *" | |
workflow_dispatch: | |
env: | |
GH__USERNAME: ${{ secrets.GH__USERNAME }} | |
GH__TOKEN: ${{ secrets.GH__TOKEN }} | |
GIT__NAME: ${{ secrets.GIT__NAME }} | |
GIT__EMAIL: ${{ secrets.GIT__EMAIL }} | |
NUGET__TOKEN: ${{ secrets.NUGET__TOKEN }} | |
GIT__TOKEN: ${{ secrets.GIT__TOKEN }} | |
jobs: | |
daily-automatic-update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setting up build version | |
run: | | |
version=$(($GITHUB_RUN_NUMBER)) | |
echo "BUILD_VERSION=3.0.$version" >> ${GITHUB_ENV} | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v5 | |
with: | |
dotnet-version: 9.0.x | |
- name: Install dependencies with retry | |
run: | | |
retries=5 | |
base_wait_time=15 | |
exponent=2 | |
for i in $(seq 1 $retries); do | |
if dotnet restore; then | |
break | |
fi | |
if [ $i -lt $retries ]; then | |
wait_time=$(awk "BEGIN {print int($base_wait_time * ($exponent ^ ($i - 1)))}") | |
echo "dotnet restore failed, retrying in $wait_time seconds..." | |
sleep $wait_time | |
else | |
echo "dotnet restore failed after $retries retries." | |
exit 1 | |
fi | |
done | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Copy Roslyn BuildHost files | |
run: | | |
host_source=$(find ~/.nuget/packages/microsoft.codeanalysis.workspaces.msbuild -type d -name "BuildHost-netcore") | |
host_target=src/bin/Release/net9.0/BuildHost-netcore | |
mkdir -p "$host_target" | |
cp -r "$host_source/"* "$host_target/" | |
- name: Run | |
run: dotnet run --project src/Soenneker.GitHub.Runners.OpenApiClient.csproj --no-restore --verbosity normal --framework net9.0 --configuration Release |