-
Notifications
You must be signed in to change notification settings - Fork 150
56 lines (56 loc) · 2.15 KB
/
release.yml
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
name: release
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
tag:
description: 'tag and release to create'
# Input has to be provided for the workflow to run
required: true
env:
GITHUB_ENV: ".env"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: master
- name: Install go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version-file: go.mod
- name: Login to dockerhub to push the image
run: echo "${{ secrets.DockerHubToken }}" | docker login --username ${DOCKER_USER} --password-stdin
env:
DOCKER_USER: ${{ secrets.DockerHubUser }}
- name: Publish Docker Image
env:
VERSION: ${{ github.event.inputs.tag }}
run: make ci publish
- name: run make bump-version
run: make bump-version
env:
NEW_VERSION: ${{ github.event.inputs.tag }}
- name: commit manifests
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5
with:
message: "create release manifests for ${{ github.event.inputs.tag }}"
add: "releases/ VERSION CHANGELOG.md"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# target commit should be the commit with the new release manifest, not the commit when workflow was triggered
- name: find target commit to tag
run: |
sha=$(git rev-parse HEAD)
echo "TARGET_SHA=$sha" >> $GITHUB_ENV
- name: Create GitHub Release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target_commitish: ${{ env.TARGET_SHA }}
tag_name: ${{ github.event.inputs.tag }}
name: Release ${{ github.event.inputs.tag }}
body: See the [CHANGELOG](https://github.com/digitalocean/digitalocean-cloud-controller-manager/blob/${{ github.event.inputs.tag }}/CHANGELOG.md) for details.