Publish Nightly Server Release #182
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: Publish Nightly Server Release | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| check_date: | |
| runs-on: ubuntu-latest | |
| name: Check latest commit | |
| outputs: | |
| should_run: ${{ steps.should_run.outputs.should_run }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Print Commit Hash | |
| run: echo ${{ github.sha }} | |
| - id: should_run | |
| continue-on-error: true | |
| name: Check if the latest commit was within the last 24 hours | |
| if: ${{ github.event_name == 'schedule' }} | |
| run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" | |
| server: | |
| name: Publish Nightly Server Builds | |
| runs-on: ubuntu-latest | |
| needs: check_date | |
| if: ${{ needs.check_date.outputs.should_run != 'false' && github.ref == 'refs/heads/develop' }} | |
| permissions: | |
| contents: write | |
| env: | |
| BonesBackendConfiguration__UseInMemoryDb: true | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-env | |
| - name: Build API Packages | |
| run: | | |
| cd Services/Bones.Api | |
| dotnet deb --configuration Release --version-suffix nightly --output ../../publish/ | |
| dotnet rpm --configuration Release --version-suffix nightly --output ../../publish/ | |
| cd ../.. | |
| - name: Build Background Service Packages | |
| run: | | |
| cd Services/Bones.BackgroundService | |
| dotnet deb --configuration Release --version-suffix nightly --output ../../publish/ | |
| dotnet rpm --configuration Release --version-suffix nightly --output ../../publish/ | |
| cd ../.. | |
| - name: Delete previous release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release delete nightly --cleanup-tag --yes | |
| sleep 10 | |
| - name: Upload Nightly Server Packages | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| body: Nightly release of server artifacts | |
| name: Nightly Server Release | |
| tag: 'nightly' | |
| makeLatest: true | |
| prerelease: true | |
| artifacts: './publish/Bones.Api.*.linux-x64.deb,./publish/Bones.Api.*.linux-x64.rpm,./publish/Bones.BackgroundService.*.linux-x64.deb,./publish/Bones.BackgroundService.*.linux-x64.rpm' |