Skip to content

Commit

Permalink
Merge pull request #318 from lockdown-systems/317-linux-releases
Browse files Browse the repository at this point in the history
Create workflow to make x64 and arm64 linux builds
  • Loading branch information
micahflee authored Dec 10, 2024
2 parents 70da00f + a5b2f08 commit 514146b
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 52 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/linux-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Release for Linux

on:
push:
tags:
- "v*"

jobs:
build-x86_64:
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Make sure the version string matches the tag
run: |
CYD_VERSION=$(cat package.json | grep '"version"' | cut -d'"' -f4)
TAG_VERSION=${GITHUB_REF#refs/tags/}
TAG_VERSION=${TAG_VERSION#v} # strip the leading 'v' from the tag
if [ "$CYD_VERSION" != "$TAG_VERSION" ]; then
echo "::error file=package.json,title=Version check failed::Version string in package.json $CYD_VERSION does not match the tag $TAG_VERSION"
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker buildx create --use
docker buildx build -t my-builder --load .
- name: Build Linux release in Docker container
run: docker run --rm -v $(pwd):/workspace -w /workspace my-builder ./scripts/make-linux-release.sh

- name: Upload DEB artifacts
uses: actions/upload-artifact@v4
with:
name: deb-packages-x86_64
path: out/make/deb/x64/cyd_*.deb

- name: Upload RPM artifacts
uses: actions/upload-artifact@v4
with:
name: rpm-packages-x86_64
path: out/make/rpm/x64/cyd-*.rpm

- name: Upload ZIP artifacts
uses: actions/upload-artifact@v4
with:
name: zip-packages-x86_64
path: out/make/zip/linux/x64/Cyd-*.zip

build-arm64:
runs-on: ubuntu-arm64

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Make sure the version string matches the tag
run: |
CYD_VERSION=$(cat package.json | grep '"version"' | cut -d'"' -f4)
TAG_VERSION=${GITHUB_REF#refs/tags/}
TAG_VERSION=${TAG_VERSION#v} # strip the leading 'v' from the tag
if [ "$CYD_VERSION" != "$TAG_VERSION" ]; then
echo "::error file=package.json,title=Version check failed::Version string in package.json $CYD_VERSION does not match the tag $TAG_VERSION"
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker buildx create --use
docker buildx build -t my-builder --load .
- name: Build Linux release in Docker container
run: docker run --rm -v $(pwd):/workspace -w /workspace my-builder ./scripts/make-linux-release.sh

- name: Upload DEB artifacts
uses: actions/upload-artifact@v4
with:
name: deb-packages-arm64
path: out/make/deb/arm64/cyd_*.deb

- name: Upload RPM artifacts
uses: actions/upload-artifact@v4
with:
name: rpm-packages-arm64
path: out/make/rpm/arm64/cyd-*.rpm

- name: Upload ZIP artifacts
uses: actions/upload-artifact@v4
with:
name: zip-packages-arm64
path: out/make/zip/linux/arm64/Cyd-*.zip
5 changes: 4 additions & 1 deletion Dockerfile-linux-release → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# For making linux releases

FROM node:20-bookworm

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
Expand All @@ -8,4 +10,5 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
zip \
sudo

WORKDIR /app
WORKDIR /workspace

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cyd",
"private": true,
"version": "1.0.15",
"version": "1.0.16-dev",
"main": ".vite/build/main.js",
"description": "Automatically delete your data from tech platforms, except for what you want to keep",
"license": "proprietary",
Expand Down
7 changes: 7 additions & 0 deletions scripts/make-linux-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
CYD_VERSION=$(cat package.json | grep '"version"' | cut -d'"' -f4)
if [[ "$CYD_VERSION" == *-dev ]]; then
npm run make-dev-linux
else
npm run make-prod-linux
fi
24 changes: 0 additions & 24 deletions scripts/publish-dev-linux.sh

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/publish-prod-linux.sh

This file was deleted.

0 comments on commit 514146b

Please sign in to comment.