Skip to content

check update: show unstable channel #43

check update: show unstable channel

check update: show unstable channel #43

Workflow file for this run

name: Build for release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if version matches
run: |
VERSION=$(cat VERSION)
if [[ -z "$VERSION" ]]; then
echo "empty VERSION"
exit 1
fi
if [[ "$GIT_TAG" != "$VERSION"* ]]; then
echo "VERSION=${VERSION} but GIT_TAG=${GIT_TAG}"
exit 1
fi
echo -n "${GIT_TAG}" > VERSION
env:
GIT_TAG: ${{ github.ref_name }}
- name: Metadata
id: metadata
run: |
BUILD_NUM=$(date -u +%Y%m%d%H%M%S)
echo "BUILD_NUM=$BUILD_NUM (env)"
echo "BUILD_NUM=$BUILD_NUM" >> "$GITHUB_ENV"
COMMIT_HASH=$(git rev-parse --short HEAD)
echo "COMMIT_HASH=$COMMIT_HASH (env)"
echo "COMMIT_HASH=$COMMIT_HASH" >> ${GITHUB_ENV}
PRERELEASE=false
echo "${GITHUB_REF_NAME}" | grep -q - && PRERELEASE=true
echo "PRERELEASE=${PRERELEASE} (output)"
echo "PRERELEASE=${PRERELEASE}" >> "$GITHUB_OUTPUT"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install npm dependencies
run: |
cd web
npm install
- name: Build frontend
run: |
export REACT_APP_CONTAINERUP_VERSION=$(cat VERSION)
export REACT_APP_CONTAINERUP_BUILD=${BUILD_NUM}
export REACT_APP_CONTAINERUP_COMMIT=${COMMIT_HASH}
export GENERATE_SOURCEMAP=false
cd web
npm run build
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.19.0'
check-latest: true
- name: Build project for linux-amd64
run: ./build.sh
env:
GOARCH: amd64
GOOS: linux
- name: Build project for linux-arm64
run: ./build.sh
env:
GOARCH: arm64
GOOS: linux
- name: Build project for linux-arm
run: ./build.sh
env:
GOARCH: arm
GOOS: linux
- name: Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
draft: true
prerelease: ${{ steps.metadata.PRERELEASE }}
files: |
containerup_linux_amd64
containerup_linux_arm64
containerup_linux_arm
- name: Build containers
uses: ContainerUp/podman-in-podman-build@v1
with:
podman-image: quay.io/containers/podman:v4.6
platforms: |
linux/amd64
linux/arm64
linux/arm
repository: containerup
tags: |
latest
${{ github.ref_name }}
- name: Push to quay.io
uses: redhat-actions/push-to-registry@v2
with:
image: containerup
tags: ${{ github.ref_name }}
registry: quay.io/containerup
username: containerup+github
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Push to quay.io (latest)
if: ${{ steps.metadata.PRERELEASE == 'false' }}
uses: redhat-actions/push-to-registry@v2
with:
image: containerup
tags: latest
registry: quay.io/containerup
username: containerup+github
password: ${{ secrets.QUAY_IO_PASSWORD }}