-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.32 KB
/
publish-packages.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Publish packages
on:
push:
branches:
- main
workflow_dispatch:
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: Fix permissions of any binary in package/version/bin
run: ./fix-permissions.sh
# - 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: |
DIRS=$(find packages -mindepth 2 -maxdepth 2 -type d -print)
for DIR in ${DIRS[@]}; do
PACKAGE=$(echo $DIR | awk -F"/" '{ print $(NF-1)":"$NF }')
echo "Pushing package $PACKAGE from $DIR into ghcr.io/${{github.repository}}/$PACKAGE"
imgpkg push -i ghcr.io/${{github.repository}}/$PACKAGE -f $DIR --registry-username=${{github.actor}} --registry-password=${{secrets.GITHUB_TOKEN}}
done