Skip to content

Building binary releases #20

Building binary releases

Building binary releases #20

Workflow file for this run

name: Building binary releases
on:
workflow_dispatch
permissions:
contents: write
env:
SHELL: /bin/bash
jobs:
build_pkg:
runs-on: ubuntu-latest
container: golang:bookworm
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
cd /tmp/
APT_PARAMS='apt -y -qq -o=Dpkg::Use-Pty=0'
$APT_PARAMS update
$APT_PARAMS install sudo
APT_PARAMS='sudo apt -y -qq -o=Dpkg::Use-Pty=0'
$APT_PARAMS update
$APT_PARAMS install curl git
curl -fsSL https://get.pnpm.io/install.sh | sh -
- name: Build
run: |
cd /tmp/
RELEASE_DATE="$(date '+%Y%m%d')"
RELEASE_FILE="/tmp/medium.rip/medium.rip"
HASH_VALUE="/tmp/medium.rip.sha256"
echo "RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_ENV
echo "HASH_VALUE=$HASH_VALUE" >> $GITHUB_ENV
echo "RELEASE_FILE=$RELEASE_FILE" >> $GITHUB_ENV
#PNPM_BIN="/home/runner/.local/share/pnpm/pnpm"
PNPM_BIN="/github/home/.local/share/pnpm/pnpm"
git clone "https://github.com/mycodedoesnotcompile2/medium.rip.git"
cd "/tmp/medium.rip/frontend/"
mv postcss.config.ts postcss.config.cjs
$PNPM_BIN i
$PNPM_BIN approve-builds
$PNPM_BIN run build
cd "/tmp/medium.rip/"
go mod download
go build -ldflags='-w -s -extldflags "-static"' .
ls -alh $RELEASE_FILE && file $RELEASE_FILE && chmod o+x $RELEASE_FILE
sha256sum --tag $RELEASE_FILE | tee -a $HASH_VALUE
- name: Create a new Github release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ env.HASH_VALUE }}
name: ${{ env.RELEASE_DATE }}
tag_name: ${{ env.RELEASE_DATE }}
files: |
${{ env.RELEASE_FILE }}