|
| 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 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + submodules: recursive |
| 25 | + - name: Get new CBMC version number |
| 26 | + id: cbmc_version_number |
| 27 | + run: | |
| 28 | + NEW_CBMC_VERSION=$(grep '^CBMC_VERSION =' src/config.inc | cut -d = -f 2 | scripts/increment_version.sh) |
| 29 | + echo ::set-env name=CBMC_VERSION::$NEW_CBMC_VERSION |
| 30 | + echo ::set-output name=CBMC_VERSION::$NEW_CBMC_VERSION |
| 31 | + - name: Update CBMC version |
| 32 | + run: | |
| 33 | + sed -i "s/CBMC_VERSION = .*/CBMC_VERSION = $CBMC_VERSION/" src/config.inc |
| 34 | + - name: Set git identity to github bot |
| 35 | + run: | |
| 36 | + git config --local user.name github-actions |
| 37 | + git config --local user.email "[email protected]" |
| 38 | + - name: Commit changes |
| 39 | + run: | |
| 40 | + git commit -a -m "Bump version to $CBMC_VERSION" |
| 41 | + - name: Push changes |
| 42 | + run: | |
| 43 | + git push |
| 44 | + perform-release: |
| 45 | + needs: bump-cbmc-version |
| 46 | + runs-on: ubuntu-20.04 |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v2 |
| 49 | + - name: Create release |
| 50 | + uses: actions/create-release@v1 |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + tag_name: cbmc-${{needs.bump-cbmc-version.outputs.CBMC_VERSION}} |
| 55 | + release_name: cbmc-${{needs.bump-cbmc-version.outputs.CBMC_VERSION}} |
| 56 | + draft: false |
| 57 | + prerelease: true |
0 commit comments