Syse 360/add draft release support #62
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: Release | |
on: | |
pull_request: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
test-controller-api: | |
runs-on: ubuntu-latest | |
container: tykio/gromit:v1.8 | |
outputs: | |
conf: ${{ steps.params.outputs.api_conf }} | |
db: ${{ steps.params.outputs.api_db }} | |
cache_db: ${{ steps.params.outputs.api_cache_db }} | |
pump: ${{ steps.params.outputs.pump }} | |
sink: ${{ steps.params.outputs.sink }} | |
gd_tag: ${{ steps.params.outputs.gd_tag }} | |
versions: ${{ steps.params.outputs.versions }} | |
exclude: ${{ steps.params.outputs.exclude }} | |
steps: | |
- name: set params | |
id: params | |
env: | |
REPO: ${{ github.repository }} | |
# Cover pull_request_target too | |
BASE_REF: ${{startsWith(github.event_name, 'pull_request') && github.base_ref || github.ref}} | |
TAGS: "master" | |
IS_PR: ${{startsWith(github.event_name, 'pull_request') && 'yes' }} | |
IS_TAG: ${{startsWith(github.ref, 'refs/tags') && 'yes' }} | |
JOB: api | |
run: gromit policy controller --loglevel debug | tee -a "$GITHUB_OUTPUT" | |
release: | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: CI env | |
run: | |
tar czf ci-env.tgz auto/ | |
- uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.ORG_GH_TOKEN }} | |
name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
draft: ${{ endsWith(github.ref_name, '-rc') || endsWith(github.ref_name, '-alpha') || endsWith(github.ref_name, '-beta') }} | |
body_path: auto/release.md | |
files: ci-env.tgz |