Skip to content

Testing

Testing #1

name: Publish packages
on:
push:
branches:
- main
workflow_dispatch:
# jobs:
# publish-packages:
# runs-on: ubuntu-20.04
# steps:
# - name: Check out the repo
# uses: actions/checkout@v2
# - name: Install imgpkg
# shell: bash
# run: |
# wget -nv -O- https://github.com/vmware-tanzu/carvel-imgpkg/releases/download/v0.28.0/imgpkg-linux-amd64 > /tmp/imgpkg
# chmod 755 /tmp/imgpkg
# - name: Calculate variables
# run: |
# echo "REPOSITORY_SHA7=${GITHUB_SHA::7}" >>${GITHUB_ENV}
# - name: Build and publish tce-0.11
# shell: bash
# run: |
# packages/tce-0.11/build.sh
# /tmp/imgpkg push -i ghcr.io/${{github.repository}}/tce-0.11:sha-${REPOSITORY_SHA7} -f packages/tce-0.11 --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}
# - name: Build and publish tce-0.12
# shell: bash
# run: |
# packages/tce-0.12/build.sh
# /tmp/imgpkg push -i ghcr.io/${{github.repository}}/tce-0.12:sha-${REPOSITORY_SHA7} -f packages/tce-0.12 --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}
# #- name: Build and publish azure-cli
# # shell: bash
# # run: |
# # packages/azure-cli/build.sh
# # /tmp/imgpkg push -i ghcr.io/${{github.repository}}/azure-cli:sha-${REPOSITORY_SHA7} -f /opt/packages/azure-cli --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}
# - name: Build and publish argocd-2.10.6
# shell: bash
# run: |
# packages/argocd-2.10.6/build.sh
# /tmp/imgpkg push -i ghcr.io/${{github.repository}}/argocd-2.10.6:sha-${REPOSITORY_SHA7} -f packages/argocd-2.10.6 --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}
jobs:
publish-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Carvel tools
shell: bash
run: curl -L https://carvel.dev/install.sh | bash
- name: vendir sync
run: vendir sync
# - name: Calculate variables
# shell: bash
# run: |
# REPOSITORY_OWNER=${{github.repository_owner}}
# echo "REPOSITORY_OWNER=${REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
# echo "REPOSITORY_TAG=${GITHUB_REF##*/}" >>${GITHUB_ENV}
# echo "REPOSITORY_SHA_TAG=sha-${GITHUB_SHA::7}" >>${GITHUB_ENV}
- name: Iterate over directories
run: |
IFS=$'\n' DIRS=( $(find packages -type d -mindepth 2 -maxdepth 2 -print) )
for DIR in $DIRS; do
PACKAGE=$(echo $DIR | awk -F"/" '{ print $(NF-1)"-"$NF }')
imgpkg push -i ghcr.io/${{github.repository}}/$PACKAGE -f $DIR --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}
done