Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Make flank release more automatically #1352

Merged
merged 8 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/create_new_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create new release

on:
pull_request:
types: [ closed ]

jobs:
create_release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') && contains(github.event.pull_request.user.login, 'flank-release[bot]') && contains(github.event.pull_request.title, 'release notes for')
steps:
- uses: actions/checkout@v2
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.FLANK_RELEASE_APP_ID }}
private_key: ${{ secrets.FLANK_RELEASE_PRIVATE_KEY }}

- name: Gradle Build flankScripts and add it to PATH
run: |
./flank-scripts/bash/buildFlankScripts.sh
echo "./flank-scripts/bash" >> $GITHUB_PATH
- name: Set next release tag variable
run: |
TAG=$(flankScripts ci nextReleaseTag --token=${{ secrets.GITHUB_TOKEN }})
echo "NEXT_RELEASE_TAG=$(echo $TAG)" >> $GITHUB_ENV

- name: Push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ steps.generate-token.outputs.token }}
custom_tag: ${{ env.NEXT_RELEASE_TAG }}
tag_prefix: ''
2 changes: 2 additions & 0 deletions .github/workflows/release_notes_generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Generate release notes for next commit"

on:
workflow_dispatch:
schedule:
- cron: 0 7 1 * *

jobs:
generateReleaseNotes:
Expand Down
11 changes: 9 additions & 2 deletions docs/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ Each push:
- to `master` branch run Snapshot release
- of tag `v*` run regular release

## Manual Steps
## Triggering release

### Manually
1. Navigate to [Github Actions](https://github.com/Flank/flank/actions)
2. Run job [`Generate release notes for next commit`](https://github.com/Flank/flank/actions?query=workflow%3A%22Generate+release+notes+for+next+commit%22) by using `Run Workflow` button
3. After merging, push a tag for the release
3. After merging PR, the next tag will be pushed to repository
4. Wait for CI job to finish

### Automatically
1. Release job will run each 1st day of month
2. After merging PR, the next tag will be pushed to repository
2. Wait for CI job to finish

## CI Steps
1. Gradle Build flankScripts and add it to PATH
2. Set environment variables
Expand Down