Skip to content

Commit

Permalink
Fix release workflow
Browse files Browse the repository at this point in the history
The release workflow stopped working. This commit fixes it and
also updates actions used by it. To simplify the project management,
the Homebrew formula is also moved from the "homebrew-aiac"
repository into this repository.
  • Loading branch information
ido50 committed Jun 11, 2024
1 parent 0fc48d4 commit c7d259d
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 96 deletions.
42 changes: 36 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,42 @@ on:
push:
tags:
- "v*"

workflow_call:
permissions:
id-token: write # For cosign
packages: write # For GHCR
contents: write # For goreleaser
jobs:
release:
name: Release
uses: ./.github/workflows/reusable-release.yaml
with:
goreleaser_config: goreleaser.yml
goreleaser_options: '--rm-dist --timeout 90m'
secrets: inherit
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Show available Docker Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to ghcr.io registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required by goreleaser-action for changelog to work

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release -f=goreleaser.yml --clean --timeout 90m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 0 additions & 62 deletions .github/workflows/reusable-release.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.17.0
FROM alpine:3.20
RUN apk --no-cache add ca-certificates git
COPY aiac /usr/local/bin/aiac
ENTRYPOINT ["aiac"]
40 changes: 13 additions & 27 deletions goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
project_name: aiac
builds:
- main: main.go
Expand All @@ -24,36 +25,21 @@ builds:
ignore:
- goos: darwin
goarch: 386
# modernc.org/sqlite doesn't support the following pairs
- goos: freebsd
goarch: arm
- goos: freebsd
goarch: arm64

archives:
- format: tar.gz
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}"
replacements:
amd64: 64bit
386: 32bit
arm: ARM
arm64: ARM64
ppc64le: PPC64LE
darwin: macOS
linux: Linux
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
dragonfly: DragonFlyBSD
files:
- README.md
- LICENSE
brews:
- tap:
- repository:
owner: gofireflyio
name: homebrew-aiac
name: aiac
directory: homebrew
homepage: "https://github.com/gofireflyio/aiac"
description: "Artificial Intelligence Infrastructure-as-Code Generator"
license: "Apache-2.0"
test: |
system "#{bin}/aiac", "--help"
Expand All @@ -74,8 +60,8 @@ dockers:
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/gofireflyio/aiac"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.url=https://www.gofirefly.io/"
- "--label=org.opencontainers.image.documentation=https://gofirefly.io/"
- "--label=org.opencontainers.image.url=https://www.firefly.ai/"
- "--label=org.opencontainers.image.documentation=https://firefly.ai/"
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/gofireflyio/aiac:{{ .Version }}-arm64"
Expand All @@ -93,8 +79,8 @@ dockers:
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/gofireflyio/aiac"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.url=https://www.gofirefly.io"
- "--label=org.opencontainers.image.documentation=https://www.gofirefly.io/"
- "--label=org.opencontainers.image.url=https://www.firefly.ai/"
- "--label=org.opencontainers.image.documentation=https://www.firefly.ai/"
- "--platform=linux/arm64"
- image_templates:
- "ghcr.io/gofireflyio/aiac:{{ .Version }}-s390x"
Expand All @@ -112,8 +98,8 @@ dockers:
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/gofireflyio/aiac"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.url=https://www.gofirefly.io"
- "--label=org.opencontainers.image.documentation=https://www.gofirefly.io/"
- "--label=org.opencontainers.image.url=https://www.firefly.ai/"
- "--label=org.opencontainers.image.documentation=https://www.firefly.ai/"
- "--platform=linux/s390x"
- image_templates:
- "ghcr.io/gofireflyio/aiac:{{ .Version }}-ppc64le"
Expand All @@ -131,8 +117,8 @@ dockers:
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.source=https://github.com/gofireflyio/aiac"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.url=https://www.gofirefly.io"
- "--label=org.opencontainers.image.documentation=https://www.gofirefly.io/"
- "--label=org.opencontainers.image.url=https://www.firefly.ai/"
- "--label=org.opencontainers.image.documentation=https://www.firefly.ai/"
- "--platform=linux/ppc64le"

docker_manifests:
Expand Down
51 changes: 51 additions & 0 deletions homebrew/aiac.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Aiac < Formula
desc "Artificial Intelligence Infrastructure-as-Code Generator"
homepage "https://github.com/gofireflyio/aiac"
version "4.2.0"

on_macos do
if Hardware::CPU.intel?
url "https://github.com/gofireflyio/aiac/releases/download/v4.2.0/aiac_4.2.0_macOS-64bit.tar.gz"
sha256 "b8f646ea3f040c7b7ead7e484a0085431e699bea6809d6faf17337333148afb8"

def install
bin.install "aiac"
end
end
if Hardware::CPU.arm?
url "https://github.com/gofireflyio/aiac/releases/download/v4.2.0/aiac_4.2.0_macOS-ARM64.tar.gz"
sha256 "333d6e23fcb00d4f2603fc65abc65e9e43e91979158b6c8eef49322b788d7892"

def install
bin.install "aiac"
end
end
end

on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/gofireflyio/aiac/releases/download/v4.2.0/aiac_4.2.0_Linux-ARM64.tar.gz"
sha256 "bb9c7408bac1017378accffb024fbe64ffceb0f16255e703762ae7dadaf3f9cb"

def install
bin.install "aiac"
end
end
if Hardware::CPU.intel?
url "https://github.com/gofireflyio/aiac/releases/download/v4.2.0/aiac_4.2.0_Linux-64bit.tar.gz"
sha256 "6cdb8eedb8ba22d2449dc6b3af43f5279a6bbca6b038ece3e520243b58f15a51"

def install
bin.install "aiac"
end
end
end

test do
system "#{bin}/aiac", "--help"
end
end

0 comments on commit c7d259d

Please sign in to comment.