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 secrets: 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: Test credential run: | echo ${S3_AK:0:4}" "${S3_SK:0:4}" env: S3_AK: ${{ secrets.S3_AK }} S3_SK: ${{ secrets.S3_SK }} - name: Configure MinIO client run: | mc alias set s3piskot https://s3.piskot.si "${S3_AK}" "${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" env: S3_AK: ${{ secrets.S3_AK }} S3_SK: ${{ secrets.S3_SK }} - 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/