Skip to content

chore(deps): bump actions/setup-go from 6.0.0 to 6.1.0 #56

chore(deps): bump actions/setup-go from 6.0.0 to 6.1.0

chore(deps): bump actions/setup-go from 6.0.0 to 6.1.0 #56

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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
path: e2e/logs
- name: upload build artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: build
path: build.tar
- uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Download artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.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@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to ghcr.io
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.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/*