diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ef84714..179d7f8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/.github/workflows/reusable-release.yaml b/.github/workflows/reusable-release.yaml deleted file mode 100644 index 6072580..0000000 --- a/.github/workflows/reusable-release.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: Reusable release -on: - workflow_call: - inputs: - goreleaser_config: - description: 'file path to GoReleaser config' - required: true - type: string - goreleaser_options: - description: 'GoReleaser options separated by spaces' - default: '' - required: false - type: string - -env: - GH_USER: "liavyona" - -jobs: - release: - name: Release - runs-on: ubuntu-latest - env: - DOCKER_CLI_EXPERIMENTAL: "enabled" - permissions: - id-token: write # For cosign - packages: write # For GHCR - contents: read # Not required for public repositories, but for clarity - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Show available Docker Buildx platforms - run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Login to ghcr.io registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ env.GH_USER }} - password: ${{ secrets.RELEASE_TOKEN }} - - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version-file: go.mod - - - name: GoReleaser - uses: goreleaser/goreleaser-action@v3 - with: - version: v1.4.1 - args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}} - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index adb352e..3a4dfb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/goreleaser.yml b/goreleaser.yml index 0f16985..b8f1630 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 project_name: aiac builds: - main: main.go @@ -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" @@ -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" @@ -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" @@ -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" @@ -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: diff --git a/homebrew/aiac.rb b/homebrew/aiac.rb new file mode 100644 index 0000000..47c3812 --- /dev/null +++ b/homebrew/aiac.rb @@ -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