Skip to content

release

release #55

Workflow file for this run

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@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: master
- name: Install go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
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@c062e08bd532815e2082a85e87e3ef29c3e6d191
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.