Skip to content

chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0 #82

chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0

chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0 #82

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
- uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: ~/.local/share/aquaproj-aqua
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
restore-keys: |
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
- uses: aquaproj/aqua-installer@11dd79b4e498d471a9385aa9fb7f62bb5f52a73c # v4.0.4
with:
aqua_version: v2.46.0
- name: Run unit tests
run: |
make test
- name: Build all
run: |
make all
make archive
- name: Run e2e tests
run: |
aqua i
make test-e2e
- name: upload e2e test logs
if: failure()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
path: e2e/logs
- name: upload build artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: build
path: build.tar
- uses: actions/cache/save@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
if: github.event_name == 'push'
with:
path: ~/.local/share/aquaproj-aqua
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
build-image:
runs-on: ubuntu-latest
needs: [test]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build
- name: Extract artifacts
run: |
tar -xf build.tar
rm -f build.tar
- name: Get photon version
id: photon_metadata
run: |
source .env
echo "version=${PHOTON_VERSION}" >> $GITHUB_OUTPUT
echo "sha256=${PHOTON_SHA256SUM}" >> $GITHUB_OUTPUT
echo "revision=${CONTAINER_REVISION}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to ghcr.io
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine image tags
id: tags
run: |
IMAGE=ghcr.io/pddg/photon
TAG="${{ steps.photon_metadata.outputs.version }}-rev.${{ steps.photon_metadata.outputs.revision }}"
if docker manifest inspect $IMAGE:$TAG > /dev/null 2>&1; then
echo "Tag $TAG already exists, skipping"
TAGS="latest"
else
echo "$TAG does not exist. It will be created."
TAGS="$TAG latest"
fi
echo "tags<<EOF" >> $GITHUB_OUTPUT
for t in $TAGS; do
echo $IMAGE:$t >> $GITHUB_OUTPUT
done
echo "EOF" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
PHOTON_VERSION=${{ steps.photon_metadata.outputs.version }}
PHOTON_SHA256SUM=${{ steps.photon_metadata.outputs.sha256 }}
GIT_SHA=${{ github.sha }}
tags: |
${{ steps.tags.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: [build-image]
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build
- name: Extract artifacts
run: |
tar -xf build.tar
rm -f build.tar
- name: create checksum file
run: |
sha256sum build/* > ./checksum.txt
mv ./checksum.txt build/
- name: create release if needs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source .env
TAG="${PHOTON_VERSION}-rev.${CONTAINER_REVISION}"
if [ ! -z "$(git tag -l $TAG)" ]; then
echo "Tag $TAG already exists, skipping"
exit 0
fi
echo "Tag $TAG does not exist. It will be created."
gh release create $TAG \
--title "$TAG" \
--generate-notes \
build/*