weekly-release #108
This file contains 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: weekly-release | |
# Run every Monday at 3:00 UTC. This translates to Sunday 20:00 PT. | |
on: | |
repository_dispatch: | |
types: weekly-release | |
schedule: | |
- cron: '0 3 * * 1' | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch all refs | |
run: | | |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
- name: Check for presence of .pause-release | |
run: | | |
if git cat-file -e origin/main:.pause-release 2>/dev/null; then | |
echo '::warning::Skipping release since there is a `.pause-release` file.' | |
exit 1 | |
fi | |
- name: Merge main into release | |
run: | | |
curl --request POST \ | |
--url https://api.github.com/repos/${{ github.repository }}/merges \ | |
--header "Authorization: Bearer ${{ secrets.OMEGAUPBOT_RELEASE_TOKEN }}" \ | |
--data "{\"base\":\"release\",\"head\":\"main\",\"commit_message\":\"Merge branch 'main' of github.com:omegaup/omegaup into release\"}" |