-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (57 loc) · 1.9 KB
/
bump_version.yaml
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
53
54
55
56
57
58
59
60
name: Bump version
on:
workflow_dispatch:
inputs:
name:
description: "Version to bump (major, minor, patch)"
default: "patch"
required: true
pull_request:
branches: ros1
types: [closed]
jobs:
get-bump:
name: Get version bump
runs-on: ubuntu-latest
outputs:
bump: ${{ env.BUMP }}
steps:
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
name: Get version bump
id: get-version-bump
uses: husarion-ci/[email protected]
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
run: echo "BUMP=${{ steps.get-version-bump.outputs.bump }}" >> $GITHUB_ENV
- if: github.event_name == 'workflow_dispatch'
run: echo "BUMP=${{ github.event.inputs.name }}" >> $GITHUB_ENV
catkin-release:
name: Bump version
runs-on: ubuntu-latest
needs: get-bump
outputs:
new_version: ${{ steps.catkin-release.outputs.new_version }}
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Catkin release
id: catkin-release
uses: husarion-ci/[email protected]
with:
bump: ${{ needs.get-bump.outputs.bump }}
github_token: ${{ secrets.GITHUB_TOKEN }}
git_user: action-bot
git_email: [email protected]
build-and-push-docker-image:
name: Create new docker image
runs-on: ubuntu-latest
needs: catkin-release
steps:
- name: trigger the endpoint
run: >
curl -X POST
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.GH_PAT }}"
https://api.github.com/repos/husarion/panther-docker/dispatches
-d '{"event_type":"ros-package-update","client_payload":{"image_version":"${{ needs.catkin-release.outputs.new_version }}"}}'