Skip to content

Build

Build #12

Workflow file for this run

name: Build
on:
workflow_dispatch:
jobs:
release:
name: Build
runs-on: ubuntu-22.04
steps:
###################################################
#
# Prepare
#
###################################################
- name: (PREPARE) Set up QEMU
uses: docker/setup-qemu-action@v2
- name: (PREPARE) Checkout Repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.15.0
cache: yarn
- name: (PREPARE) Install Dependencies
run: rm -rf node_modules && yarn --immutable
###################################################
#
# Build
#
###################################################
- name: (DOCS) Generate Dependencies Page
run: yarn docs:generate:dependencies
- name: (BUILD) Build Project
run: yarn build
- name: (BUILD) Setup Packaging Cache
uses: actions/cache@v3
with:
path: ~/.pkg-cache
key: pkg
- name: (BUILD) Package Binaries
run: yarn package
- name: (BUILD) Import Signing Key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.VINTNER_RELEASE_PRIVATE_KEY }}
- name: (BUILD) Sign Binaries
run: |
cd dist
for BINARY in vintner-alpine-x64 vintner-linux-arm64 vintner-linux-x64 vintner-win-x64.exe
do
gpg --no-tty --detach-sign -a --local-user vintner-release ${BINARY}
done
- name: (BUILD) Compress Binaries
run: |
cd dist
for BINARY in vintner-alpine-x64 vintner-linux-arm64 vintner-linux-x64 vintner-win-x64.exe
do
tar -cJf ${BINARY}.xz ${BINARY}
done
###################################################
#
# Release
#
###################################################
- name: (RELEASE) Delete Build Release
run: gh release delete build-${GITHUB_SHA} --cleanup-tag --yes || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: (RELEASE) Delete Build Tag (Local)
run: git tag --delete build-${GITHUB_SHA} || true
- name: (RELEASE) Create Build Release (and Tag)
run: gh release create build-${GITHUB_SHA} -t "Build ${GITHUB_SHA}" -n "This is the build of the commit ${GITHUB_SHA}" ./dist/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
###################################################
#
# Docker
#
###################################################
- name: (DOCKER) Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: (DOCKER) Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}