Skip to content

build-cron

build-cron #396

Workflow file for this run

name: build-cron
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
matrix:
configuration: [Debug, Release]
framework: [net8.0]
steps:
- uses: kagekirin/gha-utils/.github/actions/git-checkout-tags@main
- uses: kagekirin/gha-dotnet/.github/actions/nuget-add-registry@main
with:
name: github-nuget
token: ${{ secrets.GH_NUGET_TOKEN }}
- uses: ./.github/jobactions/build
with:
configuration: ${{ matrix.configuration }}
framework: ${{ matrix.framework }}
test-nuget:
runs-on: ubuntu-latest
strategy:
matrix:
source: [nuget, github]
include:
- source: nuget
registry: https://api.nuget.org/v3/index.json
username: KageKirin
token: NUGET_ORG_TOKEN
- source: github
registry: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
username: ${{ github.repository_owner }}
token: GH_NUGET_TOKEN
needs: build
steps:
- uses: kagekirin/gha-utils/.github/actions/git-checkout-tags@main
- uses: ./.github/jobactions/nuget-prepare-publish
with:
name: ${{ matrix.source }}
registry: ${{ matrix.registry }}
username: ${{ matrix.username }}
token: ${{ secrets[matrix.token] }}
### TODO: do not tag here, instead create a branch, update dependencies (dotnet )
update-dependencies:
runs-on: ubuntu-latest
needs: test-nuget
steps:
- uses: kagekirin/gha-utils/.github/actions/git-checkout-tags@main
with:
ssh-key: "${{ secrets.DEPLOY_KEY }}"
- id: update-dependencies
uses: ./.github/jobactions/update-dependencies
- id: push-updates
shell: bash
run: git push -u origin ${{ steps.update-dependencies.outputs.branch }}
- id: create-pr
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |-
gh pr create --fill
gh pr edit -t "build: update dependencies"
- id: auto-merge-pr
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |-
j="$(gh pr status --json title,number,headRefName,body)"
num=$(jq -r .currentBranch.number <<< $j)
title="$(jq -r .currentBranch.title <<< $j) ($(jq -r .currentBranch.headRefName <<< $j)) [#$num]"
body="$(jq -r .currentBranch.body <<< $j)nn$(jq -r .currentBranch.body <<< $j)"
gh pr merge --auto -d --squash --subject "$title" --body "$body"