|
| 1 | +name: Nightly Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: '0 9 * * *' |
| 7 | + # push: |
| 8 | + # tags: |
| 9 | + # - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 10 | + |
| 11 | +env: |
| 12 | + solution: MaterialDesignToolkit.Full.sln |
| 13 | + buildConfiguration: 'Release' |
| 14 | + mdixColorsVersion: '2.1.0' |
| 15 | + mdixMahAppsVersion: '0.2.6' |
| 16 | + mdixVersion: '4.7.0' |
| 17 | + |
| 18 | +jobs: |
| 19 | + check_for_changes: |
| 20 | + if: ${{ github.repository == 'MaterialDesignInXAML/MaterialDesignInXamlToolkit' }} |
| 21 | + runs-on: windows-latest |
| 22 | + |
| 23 | + outputs: |
| 24 | + should_run: ${{ github.event_name == 'push' || steps.check_tag.outputs.has_changed }} |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + if: ${{ github.event_name != 'push' }} |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - id: check_tag |
| 33 | + name: Check nightly_release tag |
| 34 | + if: ${{ github.event_name != 'push' }} |
| 35 | + run: | |
| 36 | + $nightlyReleaseHash = $(git rev-parse nightly_release) |
| 37 | + $masterHash = $(git rev-parse master) |
| 38 | + $hasChanged = ($nightlyReleaseHash -ne $masterHash).ToString().ToLower() |
| 39 | + echo "::set-output name=has_changed::$hasChanged" |
| 40 | +
|
| 41 | + build: |
| 42 | + needs: [check_for_changes] |
| 43 | + if: ${{ needs.check_for_changes.outputs.should_run == 'true' }} |
| 44 | + runs-on: windows-latest |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v3 |
| 48 | + with: |
| 49 | + fetch-depth: 0 |
| 50 | + |
| 51 | + - name: Build and Test |
| 52 | + uses: ./.github/actions/build-and-test |
| 53 | + timeout-minutes: 20 |
| 54 | + with: |
| 55 | + solution: ${{ env.solution }} |
| 56 | + buildConfiguration: ${{ env.buildConfiguration }} |
| 57 | + nugetKey: ${{ secrets.PAT }} |
| 58 | + |
| 59 | + - name: Set Nightly Version Numbers |
| 60 | + if: ${{ github.event_name != 'push' }} |
| 61 | + run: | |
| 62 | + echo "mdixVersion=${{ env.mdixVersion }}-ci${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append |
| 63 | + echo "mdixColorsVersion=${{ env.mdixColorsVersion }}-ci${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append |
| 64 | + echo "mdixMahAppsVersion=${{ env.mdixMahAppsVersion }}-ci${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append |
| 65 | + |
| 66 | + # - name: Push Artifacts |
| 67 | + # uses: ./.github/actions/push-artifacts |
| 68 | + # timeout-minutes: 10 |
| 69 | + # with: |
| 70 | + # mdixVersion: ${{ env.mdixVersion }} |
| 71 | + # mdixColorsVersion: ${{ env.mdixColorsVersion }} |
| 72 | + # mdixMahAppsVersion: ${{ env.mdixMahappsVersion }} |
| 73 | + # demoAppPath: "MainDemo.Wpf/bin/${{ env.buildConfiguration }}" |
| 74 | + # nugetKey: ${{ secrets.PAT }} |
| 75 | + |
| 76 | + # - name: Update latest tag |
| 77 | + # if: ${{ github.event_name != 'push' }} |
| 78 | + # run: | |
| 79 | + # git config user.name github-actions |
| 80 | + # git config user.email [email protected] |
| 81 | + # git tag -f nightly_release master |
| 82 | + # git push -f --tags |
0 commit comments