Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
220bfa2649 | ||
|
|
44384b0258 | ||
|
|
fb872b35b9 | ||
|
|
14a14a642d | ||
|
|
096df6427d | ||
|
|
634735d169 | ||
|
|
26e617cb61 | ||
|
|
f1361cc59c | ||
|
|
c4ba851410 | ||
|
|
e8f4b5c284 | ||
|
|
18f61cc0dc | ||
|
|
1dba8870ee | ||
|
|
103986f5fb | ||
|
|
16189a4abe | ||
|
|
f8a54b956a | ||
|
|
d4e87a8110 | ||
|
|
b124c185ff | ||
|
|
4cceecdc6c | ||
|
|
138635dda4 | ||
|
|
c1d7ee3d5b | ||
|
|
918aa27365 | ||
|
|
fe3b447f2e | ||
|
|
b2114a92b5 | ||
|
|
3d9cdc58ba | ||
|
|
d625f0e690 | ||
|
|
5b57072cfe | ||
|
|
09894749ab | ||
|
|
ab9407b3dd | ||
|
|
8efe99c25d | ||
|
|
96e799d2c2 | ||
|
|
146dc97a19 | ||
|
|
2280796351 | ||
|
|
f47ebe0f0d | ||
|
|
e02b20f2ad | ||
|
|
356939ca7c | ||
|
|
bc83cb9fc3 | ||
|
|
2425579f42 | ||
|
|
a5d536ed67 | ||
|
|
fe4df576b7 | ||
|
|
6bada7bc28 |
@@ -1,128 +1,197 @@
|
||||
name: "publish"
|
||||
name: Release Workflow
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
release:
|
||||
types: [published]
|
||||
# This can be used to automatically publish nightlies at UTC nighttime
|
||||
# schedule:
|
||||
# - cron: "0 2 * * *" # run at 2 AM UTC
|
||||
|
||||
# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
|
||||
schedule:
|
||||
- cron: "0 2 * * *" # run at 2 AM UTC
|
||||
|
||||
jobs:
|
||||
publish-tauri:
|
||||
web:
|
||||
name: Build Docker image
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
docker:
|
||||
image: docker:dind
|
||||
options: --privileged
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- platform: "macos-14" # for Arm based macs (M1 and above).
|
||||
args: "--target aarch64-apple-darwin"
|
||||
- platform: "macos-14" # for Intel based macs.
|
||||
args: "--target x86_64-apple-darwin"
|
||||
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
|
||||
args: ""
|
||||
- platform: "ubuntu-22.04-arm"
|
||||
args: "--target aarch64-unknown-linux-gnu"
|
||||
- platform: "windows-latest"
|
||||
args: ""
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
packages: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Clone repository
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Drop-OSS/drop
|
||||
ref: release-prep
|
||||
submodules: true
|
||||
fetch-depth: 3 # fix for when this gets triggered by tag
|
||||
fetch-tags: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Node.js
|
||||
run: |
|
||||
git clone --recursive https://free-git.org/Drop-OSS/drop-app.git .
|
||||
git config --global --add safe.directory $PWD
|
||||
|
||||
- name: setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
run_install: false
|
||||
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
|
||||
|
||||
- name: install Rust nightly
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
|
||||
targets: ${{ matrix.platform == 'macos-14' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './src-tauri -> target'
|
||||
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-22.04-arm' # This must match the platform value defined above.
|
||||
echo "Installing Node.js manually for better compatibility..."
|
||||
# Remove any existing broken Node.js installation
|
||||
rm -rf /root/.cache/act/tool_cache/node || true
|
||||
|
||||
# Install Node.js using package manager
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
echo "Using apt-get..."
|
||||
apt-get update
|
||||
apt-get install -y nodejs npm
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
echo "Using apk (Alpine)..."
|
||||
apk add --no-cache nodejs npm
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
echo "Using yum..."
|
||||
yum install -y nodejs npm
|
||||
else
|
||||
echo "Downloading Node.js directly..."
|
||||
cd /tmp
|
||||
if command -v wget >/dev/null 2>&1; then
|
||||
wget -q https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz
|
||||
elif command -v curl >/dev/null 2>&1; then
|
||||
curl -sL https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz -o node-v20.11.0-linux-x64.tar.xz
|
||||
else
|
||||
echo "Cannot download Node.js - no download tool available"
|
||||
exit 1
|
||||
fi
|
||||
tar -xf node-v20.11.0-linux-x64.tar.xz
|
||||
export PATH="/tmp/node-v20.11.0-linux-x64/bin:$PATH"
|
||||
echo "/tmp/node-v20.11.0-linux-x64/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
|
||||
# Verify installation
|
||||
echo "Node.js version: $(node --version)"
|
||||
echo "NPM version: $(npm --version)"
|
||||
echo "Node.js location: $(which node)"
|
||||
|
||||
# Verify Node.js installation
|
||||
- name: Verify Node.js installation
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils
|
||||
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
|
||||
which node || echo "Node not found in PATH"
|
||||
node --version || echo "Node version command failed"
|
||||
npm --version || echo "NPM version command failed"
|
||||
echo "PATH: $PATH"
|
||||
|
||||
- name: Import Apple Developer Certificate
|
||||
if: matrix.platform == 'macos-14'
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
- name: Determine final version
|
||||
id: get_final_ver
|
||||
run: |
|
||||
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
|
||||
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
|
||||
security default-keychain -s build.keychain
|
||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
|
||||
security set-keychain-settings -t 3600 -u build.keychain
|
||||
# Ensure Node.js tools are available
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo "Node.js not found, trying alternative version detection..."
|
||||
if [ -f package.json ]; then
|
||||
# Try to parse version without jq
|
||||
BASE_VER="v$(grep '"version"' package.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')"
|
||||
else
|
||||
BASE_VER="v0.0.0"
|
||||
echo "Warning: No package.json found, using default version"
|
||||
fi
|
||||
else
|
||||
# Use jq if available (requires Node.js ecosystem)
|
||||
if command -v jq >/dev/null 2>&1; then
|
||||
BASE_VER=v$(jq -r '.version' package.json)
|
||||
else
|
||||
# Fallback parsing without jq
|
||||
BASE_VER="v$(grep '"version"' package.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')"
|
||||
fi
|
||||
fi
|
||||
|
||||
TODAY=$(date +'%Y.%m.%d')
|
||||
|
||||
echo "Today will be: $TODAY"
|
||||
echo "today=$TODAY" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Created keychain"
|
||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
||||
FINAL_VER="$BASE_VER"
|
||||
else
|
||||
FINAL_VER="${BASE_VER}-nightly.$TODAY"
|
||||
fi
|
||||
|
||||
curl https://droposs.org/drop.der --output drop.der
|
||||
echo "Drop's release tag will be: $FINAL_VER"
|
||||
echo "final_ver=$FINAL_VER" >> $GITHUB_OUTPUT
|
||||
|
||||
# swiftc libs/appletrust/add-certificate.swift
|
||||
# ./add-certificate drop.der
|
||||
# rm add-certificate
|
||||
|
||||
# echo "Added certificate to keychain using swift util"
|
||||
|
||||
## Script is equivalent to:
|
||||
sudo security authorizationdb write com.apple.trust-settings.admin allow
|
||||
sudo security add-trusted-cert -d -r trustRoot -k build.keychain -p codeSign -u -1 drop.der
|
||||
sudo security authorizationdb remove com.apple.trust-settings.admin
|
||||
|
||||
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
|
||||
echo "Imported certificate"
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
|
||||
security find-identity -v -p codesigning build.keychain
|
||||
|
||||
- name: Verify Certificate
|
||||
if: matrix.platform == 'macos-14'
|
||||
# Update Docker to compatible version
|
||||
- name: Update Docker
|
||||
run: |
|
||||
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Drop OSS")
|
||||
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
|
||||
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
|
||||
echo "Certificate imported. Using identity: $CERT_ID"
|
||||
echo "Current Docker version:"
|
||||
docker --version || echo "Docker not found"
|
||||
|
||||
# Try to update Docker if possible
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
echo "Updating Docker via apt..."
|
||||
apt-get update
|
||||
apt-get install -y docker.io || echo "Docker update failed, continuing with existing version"
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
echo "Updating Docker via apk..."
|
||||
apk add --no-cache docker || echo "Docker update failed, continuing with existing version"
|
||||
fi
|
||||
|
||||
echo "Updated Docker version:"
|
||||
docker --version
|
||||
|
||||
- name: install frontend dependencies
|
||||
run: pnpm install # change this to npm, pnpm or bun depending on which one you use.
|
||||
|
||||
- uses: tauri-apps/tauri-action@v0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
|
||||
NO_STRIP: true
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
|
||||
releaseName: "Auto-release v__VERSION__"
|
||||
releaseBody: "See the assets to download this version and install. This release was created automatically."
|
||||
releaseDraft: false
|
||||
prerelease: true
|
||||
args: ${{ matrix.args }}
|
||||
registry: docker.io
|
||||
username: getterup
|
||||
password: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
docker.io/getterup/drop-builds
|
||||
tags: |
|
||||
type=schedule,pattern=nightly
|
||||
type=schedule,pattern=nightly.${{ steps.get_final_ver.outputs.today }}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
type=semver,pattern=v{{major}}
|
||||
type=ref,event=branch,prefix=branch-
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
# set latest tag for stable releases
|
||||
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.prerelease == false }}
|
||||
|
||||
- name: Build and push image
|
||||
id: build-and-push
|
||||
run: |
|
||||
# Ensure Docker client API version is not pinned too low
|
||||
if [ -n "${DOCKER_API_VERSION}" ]; then
|
||||
echo "Overriding DOCKER_API_VERSION=${DOCKER_API_VERSION}"
|
||||
fi
|
||||
export DOCKER_API_VERSION=1.53
|
||||
echo "Using DOCKER_API_VERSION=$DOCKER_API_VERSION"
|
||||
|
||||
echo "Building image with docker build..."
|
||||
echo "Tags: ${{ steps.meta.outputs.tags }}"
|
||||
|
||||
# Build once with the first tag
|
||||
FIRST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
||||
if [ -z "$FIRST_TAG" ]; then
|
||||
echo "No tags produced by metadata action"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker build \
|
||||
--build-arg BUILD_DROP_VERSION=${{ steps.get_final_ver.outputs.final_ver }} \
|
||||
-t "$FIRST_TAG" \
|
||||
.
|
||||
|
||||
# Tag remaining tags
|
||||
echo "${{ steps.meta.outputs.tags }}" | tail -n +2 | while read -r TAG; do
|
||||
if [ -n "$TAG" ]; then
|
||||
docker tag "$FIRST_TAG" "$TAG"
|
||||
fi
|
||||
done
|
||||
|
||||
# Push all tags
|
||||
echo "${{ steps.meta.outputs.tags }}" | while read -r TAG; do
|
||||
if [ -n "$TAG" ]; then
|
||||
docker push "$TAG"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user