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
41 changes: 15 additions & 26 deletions .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
- cron: '0 9 * * *'

env:
GH_TOKEN: ${{ github.token }}

defaults:
run:
shell: pwsh
Expand All @@ -16,29 +19,23 @@ jobs:
runs-on: ubuntu-latest

outputs:
should_run: ${{ steps.check_tag.outputs.has_changed }}
should_run: ${{ steps.check_for_changes.outputs.has_changed }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- id: check_tag
name: Check nightly_release tag
- id: check_for_changes
name: Check for changes
run: |
$nightlyReleaseHash = $(git rev-parse nightly_release)
$masterHash = $(git rev-parse origin/master)
$hasChanged = ($nightlyReleaseHash -ne $masterHash).ToString().ToLower()
# Grab the last two run, since the latest run will be the current one executing
$workflowList = gh run list --workflow "${{ github.workflow }}" --branch "${{ github.ref_name }}" --json databaseId --limit 2 --repo "${{ github.repository }}"
$runId = ($workflowList | ConvertFrom-Json)[1].databaseId
$lastRunHash = ((gh run view $runId --json headSha --repo "${{ github.repository }}") | ConvertFrom-Json).headSha

echo "Last hash $lastRunHash"
echo "Current hash ${{ github.sha }}"

$hasChanged = ($lastRunHash -ne "${{ github.sha }}").ToString().ToLower()
echo "Has updates $hasChanged"
"has_changed=$hasChanged" >> $env:GITHUB_OUTPUT

test:
needs: check_for_changes
runs-on: ubuntu-latest
steps:
- name: Test
run: |
echo "Test ${{ needs.check_for_changes.outputs.should_run }}"

get_versions:
needs: [check_for_changes]
Expand Down Expand Up @@ -71,11 +68,3 @@ jobs:
- name: Push NuGets
run: |
dotnet nuget push nugets/*.nupkg --api-key ${{ secrets.PAT }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Update latest tag
if: ${{ github.event_name != 'push' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git tag -f nightly_release master
git push -f --tags
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
is-full-release: true

collect_contributors:
build_release_notes:
runs-on: ubuntu-latest
name: Generate Release Notes

Expand Down Expand Up @@ -96,7 +96,6 @@ jobs:
name: IconChanges
path: "IconChanges*.md"


create_release:
needs: [collect_contributors, build_artifacts, build_icon_changes]
runs-on: ubuntu-latest
Expand Down