Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(BUX-449): change release flow to also build docker image #404

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ node_modules/
vendor/

# Binaries for programs and plugins
dist/
gin-bin
*.exe
*.exe~
Expand Down
44 changes: 16 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
# From: https://goreleaser.com/ci/actions/#usage
name: release
name: Release
permissions:
contents: write
packages: write

env:
GO111MODULE: on

on:
push:
tags:
- '*'

permissions:
contents: write
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5.0.0
with:
distribution: goreleaser
version: latest
args: release --rm-dist --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Syndicate to GoDocs
run: make godocs
release_default:
uses: bactions/workflows/.github/workflows/release-go-server.yml@main
with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, but where is this workflow? πŸ˜„

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️

Copy link
Contributor Author

@dorzepowski dorzepowski Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version: ${{ github.ref_name }}
os: linux
go_main_file: cmd/server/main.go
release_binaries: false
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
78 changes: 0 additions & 78 deletions .goreleaser.yml

This file was deleted.

11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,6 @@ This repository was created using [MrZ's `go-template`](https://github.com/mrz18

Releases are automatically created when you create a new [git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging)!

If you want to manually make releases, please install GoReleaser:

[goreleaser](https://github.com/goreleaser/goreleaser) for easy binary or library deployment to GitHub and can be installed:

- **using make:** `make install-releaser`
- **using brew:** `brew install goreleaser`

The [.goreleaser.yml](.goreleaser.yml) file is used to configure [goreleaser](https://github.com/goreleaser/goreleaser).

<br/>

### Automatic Releases on Tag Creation (recommended)

Automatic releases via [GitHub Actions](.github/workflows/release.yml) from creating a new tag:
Expand Down
17 changes: 17 additions & 0 deletions release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9-minimal

# Set working directory
WORKDIR /app

ARG project_name
ARG TARGETPLATFORM
COPY ./dist/$TARGETPLATFORM .

ARG version
ARG tag
ENV APP_BINARY=${project_name}
ENV VERSION=${version:-develop}
ENV TAG=${tag:-master}

# Set entrypoint
ENTRYPOINT ["./$APP_BINARY"]
Loading