Create Release #90
Workflow file for this run
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: Create Release | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
tag: ${{ steps.get_tag.outputs.TAG }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get the tag without ref | |
id: get_tag | |
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//} | |
- name: Ensure changelog file exists | |
run: touch ./docs/changelog/${{ steps.get_tag.outputs.TAG }}.md | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
# Otherwise we can't rerun this to build new binaries | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
body_path: ./docs/changelog/${{ steps.get_tag.outputs.TAG }}.md | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
release-plugin: | |
runs-on: ubuntu-latest | |
needs: create-release | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch all tags | |
run: git fetch --force --tags | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.22.5 | |
# https://github.com/goreleaser/goreleaser/issues/1311 | |
- name: Get current semver tag | |
run: echo "::set-output name=CURRENT_TAG::$(git describe --tags --match "v*" --abbrev=0)" | |
id: current-tag | |
- name: Release binaries | |
run: make release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GORELEASER_CURRENT_TAG: ${{ steps.current-tag.outputs.CURRENT_TAG }} | |
push_images: | |
name: Push Docker images | |
needs: create-release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- fdb-kubernetes-operator | |
- fdb-data-loader | |
include: | |
- image: fdb-kubernetes-operator | |
context: ./ | |
name: foundationdb/fdb-kubernetes-operator | |
file: ./Dockerfile | |
- image: fdb-data-loader | |
context: ./sample-apps/data-loader | |
name: foundationdb/fdb-data-loader | |
file: ./sample-apps/data-loader/Dockerfile | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Get the version | |
id: get_tag | |
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push to registry | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
TAG=${{ steps.get_sha.outputs.TAG }} | |
push: true | |
context: ${{ matrix.context }} | |
tags: ${{ matrix.name }}:${{ steps.get_tag.outputs.TAG }} | |
file: ${{ matrix.file }} |