Release #977
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: Release | ||
| on: | ||
| workflow_run: | ||
| workflows: [Build & Test] | ||
| branches: [main] | ||
| types: [completed] | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.ref == 'refs/heads/main' || github.event_name == 'schedule' }} && "!contains(github.event.head_commit.message, '[skip-build]')" | ||
|
Check warning on line 15 in .github/workflows/release.yml
|
||
| steps: | ||
| - name: Download Databases | ||
| uses: dawidd6/action-download-artifact@v11 | ||
| with: | ||
| name: build | ||
| workflow: build.yml | ||
| - name: Download Results | ||
| uses: dawidd6/action-download-artifact@v11 | ||
| with: | ||
| name: results | ||
| workflow: build.yml | ||
| - name: Set some env variables | ||
| run: | | ||
| echo "RELEASE_DATE=$(date '+%D %T')" >> ${GITHUB_ENV} | ||
| echo "RELEASE_TAG=$(date '+%b.%d.%y.%H.%M.%S')" >> ${GITHUB_ENV} | ||
| - name: Create New Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: | | ||
| *.mmdb | ||
| name: ${{ env.RELEASE_DATE }} | ||
| tag_name: ${{ env.RELEASE_TAG }} | ||
| fail_on_unmatched_files: true | ||
| body: | | ||
| ## Built on: ${{ env.RELEASE_DATE }} | ||
| Check the project's [readme](https://github.com/HostByBelle/IP-Geolocation-DB#variants) for information about the variants available. | ||
| body_path: results.md | ||
| - name: Remove old releases | ||
| uses: dev-drprasad/delete-older-releases@v0.3.4 | ||
| with: | ||
| keep_latest: 1 | ||
| delete_tags: true | ||
| delete_expired_data: 7 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||