Skip to content

Commit

Permalink
ci(fix): Attempt to fix release.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
  • Loading branch information
hairyhenderson committed Dec 17, 2024
1 parent cec14a0 commit 19b37f1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & Push
run: |
export srcrepo=${{ github.repository}}
export srcrepo=ghcr.io/${{ github.repository}}
make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=${srcrepo} BUILDX_ACTION=--push
Expand All @@ -56,6 +56,7 @@ jobs:
docker buildx imagetools create -t ${repo}:${git_tag}-alpine ${srcrepo}:alpine
docker buildx imagetools create -t ${repo}:${major_version}-alpine ${srcrepo}:alpine
# and now DockerHub (if we don't get rate-limited)
export repo=gomplate/gomplate
docker buildx imagetools create -t ${repo}:stable ${srcrepo}:latest
docker buildx imagetools create -t ${repo}:${git_tag} ${srcrepo}:latest
Expand All @@ -65,8 +66,7 @@ jobs:
docker buildx imagetools create -t ${repo}:${git_tag}-alpine ${srcrepo}:alpine
docker buildx imagetools create -t ${repo}:${major_version}-alpine ${srcrepo}:alpine
# and now GHCR
export repo=ghcr.io/${srcrepo}
export repo=hairyhenderon/gomplate
docker buildx imagetools create -t ${repo}:stable ${srcrepo}:latest
docker buildx imagetools create -t ${repo}:${git_tag} ${srcrepo}:latest
docker buildx imagetools create -t ${repo}:${major_version} ${srcrepo}:latest
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,3 @@ jobs:
--repo ${{ github.repository }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
deploy-homebrew:
runs-on: ubuntu-latest
needs: create-release
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Bump packages
uses: Homebrew/actions/bump-packages@master
with:
token: ${{ steps.app-token.outputs.token }}
formulae: gomplate
fork: false
47 changes: 26 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Deploy Released Assets
on:
release:
types: [published]
push:
branches:
- release-fix-attempt
workflow_dispatch:

permissions:
contents: write
Expand All @@ -14,7 +18,8 @@ jobs:
environment:
name: aports
env:
TAG_NAME: ${{ github.event.release.tag_name }}
# TAG_NAME: ${{ github.event.release.tag_name }}
TAG_NAME: v4.3.0
steps:
- uses: actions/create-github-app-token@v1
id: app-token
Expand All @@ -37,16 +42,20 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: checkout alpinelinux/aports
run: |
set -ex
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git clone https://gitlab.alpinelinux.org/hairyhenderson/aports.git
git remote add upstream https://gitlab.alpinelinux.org/alpine/aports.git
git clone -v https://gitlab.alpinelinux.org/hairyhenderson/aports.git
cd aports
# note: this token expires, so needs to be rotated periodically
git remote set-url origin "https://oauth2:${{ secrets.GITLAB_ACCESS_TOKEN }}@gitlab.alpinelinux.org/hairyhenderson/aports.git"
git remote add upstream https://gitlab.alpinelinux.org/alpine/aports.git
git checkout master
- name: update fork
run: |
set -ex
cd aports
git fetch upstream
git fetch -v upstream
git rebase upstream/master
git push
- name: upgrade gomplate in aports
Expand Down Expand Up @@ -74,29 +83,25 @@ jobs:
environment:
name: homebrew
env:
TAG_NAME: ${{ github.event.release.tag_name }}
# TAG_NAME: ${{ github.event.release.tag_name }}
TAG_NAME: v4.3.0
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
# - name: Retrieve release artifacts
# id: artifacts
# run: |
# # need the checksum and archive
# gh release download ${TAG_NAME} -p "${TAG_NAME}.sha*"

# echo "sha256sum=$(cat ${TAG_NAME}.sha256)" >> $GITHUB_OUTPUT
# echo "archive=https://github.com/${{ github.repository }}/archive/refs/tags/${TAG_NAME}.tar.gz" >> $GITHUB_OUTPUT
# env:
# GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Bump packages
uses: Homebrew/actions/bump-packages@master
with:
token: ${{ steps.app-token.outputs.token }}
formulae: gomplate
fork: false
# - name: Bump packages
# uses: Homebrew/actions/bump-packages@master
# with:
# token: ${{ steps.app-token.outputs.token }}
# formulae: gomplate
# fork: true
- name: Bump package
run: brew bump --open-pr --formulae gomplate
env:
HOMEBREW_DEVELOPER: "1"
HOMEBREW_GITHUB_API_TOKEN: ${{ steps.app-token.outputs.token }}
38 changes: 38 additions & 0 deletions packaging/alpine/APKBUILD.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: Dave Henderson <dhenderson@gmail.com>
pkgname=gomplate
pkgver={{.version}}
pkgrel=0
pkgdesc="A versatile Go template processor"
url="https://github.com/hairyhenderson/gomplate"
arch="all"
license="MIT"
depends="ca-certificates"
makedepends="go"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/hairyhenderson/gomplate/archive/v$pkgver.tar.gz"

export GOFLAGS="$GOFLAGS -trimpath -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
# CGO needs to be able to be enabled for -buildmode=pie, setting it to an
# empty string is a workaround for now.
# See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15809
make build \
CGO_ENABLED= \
VERSION="$pkgver" \
COMMIT="unknown"
}

check() {
# Note: make test (that runs go test -race) doesn't work.
go test -v
}

package() {
install -D -m 755 bin/gomplate "$pkgdir"/usr/bin/gomplate
}

sha512sums="{{.sha512}} gomplate-{{.version}}.tar.gz"

0 comments on commit 19b37f1

Please sign in to comment.