2023-01-31 14:22:30 +01:00
|
|
|
# This action helps perform common actions before the build_* actions are started in parallel.
|
2022-11-11 16:15:21 +01:00
|
|
|
on:
|
2022-12-15 12:00:58 +01:00
|
|
|
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"
|
2023-01-31 14:22:30 +01:00
|
|
|
calculate-nightly-versions:
|
|
|
|
type: string
|
|
|
|
required: false
|
|
|
|
description: "Whether to calculate the version strings new Nightly builds should use"
|
|
|
|
secrets:
|
|
|
|
# Required if `calculate-nightly-versions` is set
|
|
|
|
CF_R2_ACCESS_KEY_ID:
|
|
|
|
required: false
|
|
|
|
# Required if `calculate-nightly-versions` is set
|
|
|
|
CF_R2_TOKEN:
|
|
|
|
required: false
|
|
|
|
# Required if `calculate-nightly-versions` is set
|
|
|
|
CF_R2_S3_API:
|
|
|
|
required: false
|
|
|
|
outputs:
|
|
|
|
macos-version:
|
|
|
|
description: "The version string the next macOS Nightly should use, only output for calculate-nightly-versions"
|
|
|
|
value: ${{ jobs.prepare.outputs.macos-version }}
|
2023-02-20 13:09:45 +01:00
|
|
|
linux-version:
|
|
|
|
description: "The version string the next Linux Nightly should use, only output for calculate-nightly-versions"
|
|
|
|
value: ${{ jobs.prepare.outputs.linux-version }}
|
2022-11-11 16:15:21 +01:00
|
|
|
jobs:
|
2022-12-15 12:00:58 +01:00
|
|
|
prepare:
|
|
|
|
name: Prepare
|
2023-01-31 14:22:30 +01:00
|
|
|
environment: ${{ inputs.calculate-nightly-versions && 'packages.element.io' || '' }}
|
2022-12-15 12:00:58 +01:00
|
|
|
runs-on: ubuntu-latest
|
2023-01-31 14:22:30 +01:00
|
|
|
outputs:
|
2023-02-20 13:09:45 +01:00
|
|
|
macos-version: ${{ steps.versions.outputs.macos }}
|
|
|
|
linux-version: ${{ steps.versions.outputs.linux }}
|
2022-12-15 12:00:58 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-11-11 16:15:21 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: "yarn"
|
2022-11-11 16:15:21 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- name: Install Deps
|
|
|
|
run: "yarn install --pure-lockfile"
|
2022-11-11 16:15:21 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- name: Fetch Element Web
|
|
|
|
run: yarn run fetch --noverify -d ${{ inputs.config }} ${{ inputs.version }}
|
2022-11-11 16:15:21 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
# We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action
|
|
|
|
- name: Generate cache hash files
|
|
|
|
run: |
|
|
|
|
yarn run --silent electron --version > electronVersion
|
|
|
|
cat package.json | jq -c .hakDependencies > hakDependencies.json
|
2022-12-13 15:12:40 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: webapp
|
|
|
|
retention-days: 1
|
|
|
|
path: |
|
|
|
|
webapp.asar
|
|
|
|
package.json
|
|
|
|
electronVersion
|
|
|
|
hakDependencies.json
|
2023-01-31 14:22:30 +01:00
|
|
|
|
2023-02-20 13:09:45 +01:00
|
|
|
- name: Calculate Nightly versions
|
|
|
|
id: versions
|
2023-01-31 14:22:30 +01:00
|
|
|
if: inputs.calculate-nightly-versions
|
|
|
|
run: |
|
2023-02-20 13:09:45 +01:00
|
|
|
MACOS=$(aws s3 cp s3://$R2_BUCKET/nightly/update/macos/releases.json - --endpoint-url $R2_URL --region auto | jq -r .currentRelease)
|
|
|
|
echo "macos=$(scripts/generate-nightly-version.ts --latest $MACOS)" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
LINUX=$(aws s3 cp s3://$R2_BUCKET/debian/dists/default/main/binary-amd64/Packages - --endpoint-url $R2_URL --region auto | grep "Package: element-nightly" -A 50 | grep Version -m1 | sed -n 's/Version: //p')
|
|
|
|
echo "linux=$(scripts/generate-nightly-version.ts --latest $LINUX)" >> $GITHUB_OUTPUT
|
2023-01-31 14:22:30 +01:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
2023-02-20 13:09:45 +01:00
|
|
|
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE
|
|
|
|
R2_BUCKET: 'packages-element-io-test'
|
2023-01-31 14:22:30 +01:00
|
|
|
R2_URL: ${{ secrets.CF_R2_S3_API }}
|