-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (49 loc) · 2.25 KB
/
release-drafter.yml
File metadata and controls
52 lines (49 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release Drafter
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Checkout code
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Get version
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
id: version
run: echo ::set-output name=version::$(echo $(sed -nE "s/version=(.*)/\1/p" src/main/resources/version.properties))
# Drafts your next Release notes as Pull Requests are merged into "master"
- name: Update Draft
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
id: update_draft
uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
#config-name: release-drafter.yml
name: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
version: ${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Update version
# if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
# run: sed -i -E "s/version=.*/version=${{ steps.update_draft.outputs.name }}/" src/main/resources/version.properties
- name: Update version info
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
run: sed -i -E "s~versionInfo=.*~versionInfo=https://github.com/Breeding-Insight/bi-api/releases/tag/${{ steps.update_draft.outputs.tag_name }}~" src/main/resources/version.properties
- name: Commit files
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
run: |
git config --local user.email "bidevteam@cornell.edu"
git config --local user.name "rob-ouser-bi"
git remote set-url origin https://x-access-token:${{ secrets.ROB_OUSER_TOKEN }}@github.com/${{ github.repository }}
git commit -am "[autocommit] Updating version.properties" && git push || echo "No changes to commit"