|
| 1 | +on: |
| 2 | + schedule: |
| 3 | +# ┌───────────── minute (0 - 59) |
| 4 | +# │ ┌───────────── hour (0 - 23) |
| 5 | +# │ │ ┌───────────── day of the month (1 - 31) |
| 6 | +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) |
| 7 | +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) |
| 8 | +# │ │ │ │ │ |
| 9 | +# │ │ │ │ │ |
| 10 | +# │ │ │ │ │ |
| 11 | + - cron: '0 9 * * THU' |
| 12 | + # ^ this means 9:00 AM every thursday |
| 13 | + # I can’t figure out the right syntax |
| 14 | + # for ‘every other thursday’ |
| 15 | + |
| 16 | +jobs: |
| 17 | + bump_cbmc_version: |
| 18 | + runs-on: ubuntu-20.04 |
| 19 | + outputs: |
| 20 | + cbmc_version: ${{ steps.cbmc_version_number.outputs.CBMC_VERSION }} |
| 21 | + bump_git_sha: ${{ steps.commit_bump.outputs.bump_git_sha }} |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + submodules: recursive |
| 26 | + - name: Get new CBMC version number |
| 27 | + id: cbmc_version_number |
| 28 | + run: | |
| 29 | + NEW_CBMC_VERSION=$(grep '^CBMC_VERSION =' src/config.inc | cut -d = -f 2 | scripts/increment_version.sh) |
| 30 | + echo ::set-env name=CBMC_VERSION::$NEW_CBMC_VERSION |
| 31 | + echo ::set-output name=CBMC_VERSION::$NEW_CBMC_VERSION |
| 32 | + - name: Update CBMC version |
| 33 | + run: | |
| 34 | + sed -i "s/CBMC_VERSION = .*/CBMC_VERSION = $CBMC_VERSION/" src/config.inc |
| 35 | + - name: Set git identity to github bot |
| 36 | + run: | |
| 37 | + git config --local user.name db-ci-cprover |
| 38 | + git config --local user.email "[email protected]" |
| 39 | + - name: Commit changes |
| 40 | + id: commit_bump |
| 41 | + run: | |
| 42 | + git commit -a -m "Bump version to $CBMC_VERSION" |
| 43 | + echo "::set-output name=bump_git_sha::$(git rev-parse HEAD)" |
| 44 | + - name: Push changes |
| 45 | + run: | |
| 46 | + git push |
| 47 | + perform-release: |
| 48 | + needs: bump_cbmc_version |
| 49 | + runs-on: ubuntu-20.04 |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v2 |
| 52 | + with: |
| 53 | + # We just added a commit to master, so the default GITHUB_REF doesn’t work anymore |
| 54 | + ref: master |
| 55 | + - name: DEBUG show bump version |
| 56 | + run: echo ${{ needs.bump_cbmc_version.outputs.CBMC_VERSION }} |
| 57 | + - name: Create release |
| 58 | + uses: actions/create-release@v1 |
| 59 | + env: |
| 60 | + GITHUB_TOKEN: ${{ secrets.DB_CI_CPROVER_ACCESS_TOKEN }} |
| 61 | + with: |
| 62 | + tag_name: cbmc-${{ needs.bump_cbmc_version.outputs.CBMC_VERSION }} |
| 63 | + release_name: cbmc-${{ needs.bump_cbmc_version.outputs.CBMC_VERSION }} |
| 64 | + draft: false |
| 65 | + prerelease: false |
| 66 | + commitish: ${{ needs.bump_cbmc_version.outputs.bump_git_sha }} |
0 commit comments