Skip to content

Commit

Permalink
Merge pull request #3 from nicholasjackson/dev
Browse files Browse the repository at this point in the history
Fix release workflow
  • Loading branch information
nicholasjackson committed Feb 8, 2022
2 parents 1f2dee4 + 3568545 commit b40feb6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 40 deletions.
59 changes: 21 additions & 38 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,40 +76,6 @@ jobs:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: "Executed functional test: ${{ matrix.tags }}"

tag:
name: Tag latest release
runs-on: ubuntu-latest
needs:
- build
- functional_tests
if: ${{ github.ref == 'refs/heads/main' }}

steps:
- name: Bump version and push tag
id: tag
uses: mathieudutour/github-tag-action@v5.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Remove v in Tag
id: version
uses: ashley-taylor/regex-property-action@v1.0
with:
value: ${{ steps.tag.outputs.new_tag }}
regex: "v"
replacement: ""

- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: "Automatically tagged main branch with new tag: ${{ steps.tag_version.outputs.new_tag }}"

outputs:
new_tag: ${{ steps.tag.outputs.new_tag }}
new_version: ${{ steps.version.outputs.value }}

dev-docker:
name: Build development Docker image
runs-on: ubuntu-latest
Expand Down Expand Up @@ -142,7 +108,8 @@ jobs:
name: Build production Docker image
runs-on: ubuntu-latest
needs:
- tag
- build
- functional_tests
if: ${{ github.ref == 'refs/heads/main' }}

steps:
Expand All @@ -153,14 +120,30 @@ jobs:
password: ${{ secrets.DOCKER_PASS }}

- uses: actions/checkout@v2
with:
ref: ${{ needs.tag.outputs.new_tag }}

- id: bump
uses: zwaldowski/match-label-action@v1
with:
allowed: major,minor,patch

- uses: zwaldowski/semver-release-action@v1
id: next_version
with:
dry_run: true
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
run: |
make build_docker
env:
VERSION: ${{ needs.tag.outputs.new_tag }}
VERSION_ENV: ${{ steps.next_version.outputs.version }}

- uses: zwaldowski/semver-release-action@v1
id: tag
with:
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ HELM_VERSION ?= 0.0.1
SHELL := /bin/bash
UNAME := $(shell uname)

ifeq "$(VERSION)" ""
ifeq "$(VERSION_ENV)" ""
VERSION = $(shell git log --pretty=format:'%h' -n 1)
else
VERSION = $(VERSION)
VERSION = $(VERSION_ENV)
endif

# Build and push the Arm64 and x64 images to the Docker registry
Expand Down

0 comments on commit b40feb6

Please sign in to comment.