Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
name: Setup
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
should_skip: ${{ steps.skip_check.outputs.should_skip == 'true' || steps.msg_check.outputs.skip == 'true' }}
upload_pkgs: ${{ steps.msg_check.outputs.skip != 'true' }}
skipped_by: ${{ steps.skip_check.outputs.skipped_by }}
ver: ${{ steps.computever.outputs.ver }}
checkid: ${{ steps.result_check.outpus.check_id }}
Expand All @@ -32,7 +33,11 @@ jobs:
with:
cancel_others: true
concurrent_skipping: same_content_newer


- name: Check if this run is skipped by commit message
id: msg_check
run: echo "skip=${{ github.event_name == 'push' && contains(github.event.head_commit.message, '[skip-ci]') }}" >> $env:GITHUB_OUTPUT

- name: Compute Version
id: computever
run: echo "ver=$(Get-Date -Format y.M.d).${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_OUTPUT
Expand All @@ -47,8 +52,8 @@ jobs:

upload:
needs: [setup, build]
if: github.ref_name == 'master'
if: ${{ needs.setup.upload_pkgs == 'true' && github.ref_name == 'master' && (success() || needs.setup.result == 'success') }}
name: Upload Packages
uses: ./.github/workflows/upload-packages.yml
with:
workflow-id: ${{ needs.setup.outputs.should_skip == 'true' && fromJSON(needs.setup.outputs.skipped_by).workflowId || github.run_id }}
run-id: ${{ needs.setup.outputs.should_skip == 'true' && fromJSON(needs.setup.outputs.skipped_by).id || github.run_id }}
29 changes: 22 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,37 @@ jobs:

bump-ver:
name: Bump versions
needs: [setup, build]
needs: [setup, upload-github, upload-nuget]
if: ${{ !failure() && !cancelled() }}
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Authenticate as app
uses: actions/create-github-app-token@v2
id: app_tok
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVKEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app_tok.outputs.token }} # checkout using the app token so we can push directly to the repo head
lfs: true
submodules: true

# first, make release/tag
- name: Download compiled packages
uses: actions/download-artifact@v4
with:
name: packages
path: artifacts/package/release/
github-token: ${{ github.token }}
run-id: ${{ github.run_id }}

# first, make release/tag
- name: Create release
uses: softprops/action-gh-release@v2
if: '!inputs.dryrun'
Expand Down Expand Up @@ -142,9 +155,11 @@ jobs:
if: '!inputs.prerelease'
uses: EndBug/add-and-commit@v9
with:
add: Version.props
message: "[BOT]: Bump version after ${{ needs.setup.outputs.ver }}"
committer_name: GitHub Actions
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
push: ${{ !inputs.dryrun }}
message: |
[BOT]: Bump version after ${{ needs.setup.outputs.ver }} release

[skip-ci]
default_author: github_actions
push: ${{ !inputs.dryrun && 'origin --force --set-upstream' || 'false' }}
pathspec_error_handling: exitAtEnd

4 changes: 2 additions & 2 deletions .github/workflows/upload-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Upload Packages
on:
workflow_call:
inputs:
workflow-id:
run-id:
type: string
default: ${{ github.run_id }}
description: The ID of the workflow to upload packages from
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
name: packages
path: artifacts/package/release/
github-token: ${{ github.token }}
run-id: ${{ inputs.workflow-id }}
run-id: ${{ inputs.run-id }}

- name: Push packages
run: dotnet nuget push -s "${{ inputs.nuget-url }}" -k ${{ secrets.nuget-key || github.token }} (Get-Item artifacts/package/release/*.nupkg)
Expand Down