ci(fix): Attempt to fix release.yml #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Released Assets | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- release-fix-attempt | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
deploy-alpine: | |
runs-on: ubuntu-latest | |
environment: | |
name: aports | |
env: | |
# 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 }} | |
- uses: actions/checkout@v4 | |
- name: Retrieve release artifacts | |
id: artifacts | |
run: | | |
# need the checksums | |
gh release download ${TAG_NAME} --skip-existing -p "${TAG_NAME}.sha*" | |
echo "sha256sum=$(cat ${TAG_NAME}.sha256)" >> $GITHUB_OUTPUT | |
echo "sha512sum=$(cat ${TAG_NAME}.sha512)" >> $GITHUB_OUTPUT | |
# need gomplate to template the APKBUILD! | |
gh release download ${TAG_NAME} --skip-existing -p gomplate_linux-amd64 | |
env: | |
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 -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 -v upstream | |
git rebase upstream/master | |
git push | |
- name: upgrade gomplate in aports | |
run: | | |
cd aports/community/gomplate | |
git checkout -b upgrade-gomplate-aport-${VERSION} | |
export VERSION=${TAG_NAME#v} | |
export ENVJSON="{\"version\": \"${VERSION}\", \"sha512\": \"${{ steps.artifacts.outputs.sha512sum }}\" }" | |
../../../gomplate_linux-amd64 -c .=env:///ENVJSON\?type=application/json \ | |
-f ../../../packaging/alpine/APKBUILD.tmpl \ | |
-o APKBUILD | |
git add APKBUILD | |
git commit -S -sm "community/gomplate: upgrade to ${VERSION}" | |
git push -u origin upgrade-gomplate-aport-${VERSION} | |
# open a PR | |
lab mr create --allow-collaboration \ | |
-m "community/gomplate: upgrade to ${VERSION}" \ | |
-m "https://github.com/${{ github.repository }}/releases/tag/${TAG_NAME}" | |
deploy-homebrew: | |
# runs-on: ubuntu-latest | |
runs-on: macos-latest | |
environment: | |
name: homebrew | |
env: | |
# 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: 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: true | |
# - name: Bump package | |
# run: brew bump --open-pr --formulae gomplate | |
# env: | |
# HOMEBREW_DEVELOPER: "1" | |
# HOMEBREW_GITHUB_API_TOKEN: ${{ steps.app-token.outputs.token }} | |
deploy-docker: | |
runs-on: ubuntu-latest | |
env: | |
# TAG_NAME: ${{ github.event.release.tag_name }} | |
TAG_NAME: v4.3.0 | |
steps: | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/[email protected] | |
with: | |
version: v0.14.1 | |
driver-opts: | | |
image=moby/buildkit:buildx-stable-1 | |
network=host | |
- name: Available platforms | |
run: echo {{ `${{ steps.buildx.outputs.platforms }}` }} | |
- run: docker info && docker version | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Login to GHCR | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
# NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/hairyhenderson/gomplate/settings | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build & Push | |
run: | | |
export srcrepo=ghcr.io/${{ github.repository}} | |
make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=${srcrepo} BUILDX_ACTION=--push | |
set -x | |
export repo=${srcrepo} | |
export git_tag=${TAG_NAME} | |
export major_version=${git_tag%\.*} | |
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 | |
docker buildx imagetools create -t ${repo}:stable-alpine ${srcrepo}:alpine | |
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 | |
docker buildx imagetools create -t ${repo}:${major_version} ${srcrepo}:latest | |
docker buildx imagetools create -t ${repo}:stable-alpine ${srcrepo}:alpine | |
docker buildx imagetools create -t ${repo}:${git_tag}-alpine ${srcrepo}:alpine | |
docker buildx imagetools create -t ${repo}:${major_version}-alpine ${srcrepo}:alpine | |
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 | |
docker buildx imagetools create -t ${repo}:stable-alpine ${srcrepo}:alpine | |
docker buildx imagetools create -t ${repo}:${git_tag}-alpine ${srcrepo}:alpine | |
docker buildx imagetools create -t ${repo}:${major_version}-alpine ${srcrepo}:alpine |