Files
element-desktop/.github/workflows/build_prepare.yaml
Nik Rozman cfc4a1f4f2
Some checks failed
Build Windows Package / fetch (push) Failing after 7m47s
Build Windows Package / fetch (pull_request) Failing after 7m22s
Pull Request / action (pull_request_target) Failing after 0s
Build Windows Package / setup (push) Has been cancelled
Build Windows Package / setup (pull_request) Has been cancelled
Build Windows Package / Windows Build (push) Has been cancelled
Build Windows Package / Windows Build (pull_request) Has been cancelled
Fix MinIO client alias configuration command syntax
2025-04-24 19:20:35 +02:00

88 lines
3.1 KiB
YAML

name: Prepare Build
on:
workflow_call:
inputs:
config:
type: string
required: true
description: "The config directory to use"
version:
type: string
required: false
description: "The version tag to fetch, or 'develop', will pick automatically if not passed"
outputs:
packages-dir:
description: "The directory non-deb packages for this run should live in"
value: "desktop"
deploy:
description: "Whether the build should be deployed to production"
value: false
permissions: {}
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libnss3-dev
- name: Install Yarn
run: npm install -g yarn
- name: Install Deps
run: "yarn install --frozen-lockfile"
- name: Clone Element Web
run: |
git clone https://git.piskot.si/nikrozman/element-web.git element-web
cd element-web
yarn install --frozen-lockfile
yarn build
cd ..
yarn run asar pack element-web/webapp webapp.asar
- name: Generate cache hash files
run: |
# Save electron version
NODE_ENV=production node -e "console.log(require('./package.json').devDependencies.electron)" > electronVersion
# Generate hak dependencies hash
jq -c .hakDependencies package.json | sha1sum > hakHash
if [ -d "hak" ]; then
find hak -type f -print0 | sort -z | xargs -0 sha1sum >> hakHash
fi
if [ -d "scripts/hak" ]; then
find scripts/hak -type f -print0 | sort -z | xargs -0 sha1sum >> hakHash
fi
- name: Setup MinIO client
uses: yakubique/setup-minio-cli@v1
- name: Configure MinIO client
run: |
mc alias set s3piskot https://s3.piskot.si "${{ secrets.S3_AK }}" "${{ secrets.S3_SK }}"
if ! mc alias list | grep -q "s3piskot"; then
echo "Error: Failed to set S3 alias"
exit 1
fi
echo "Successfully configured MinIO client"
- name: Upload cache files
run: |
# Upload cache files to MinIO
mc cp webapp.asar s3piskot/element-desktop/staging/
mc cp package.json s3piskot/element-desktop/staging/
mc cp electronVersion s3piskot/element-desktop/staging/
mc cp hakHash s3piskot/element-desktop/staging/