mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
Port over artifact scripts from old project (#187)
This commit is contained in:
parent
933c5d66e9
commit
8ebde7e766
4
scripts/artifacts/.gitignore
vendored
Normal file
4
scripts/artifacts/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*builds/
|
||||
*-staged/
|
||||
*.zip
|
||||
*.dmg
|
49
scripts/artifacts/README.md
Normal file
49
scripts/artifacts/README.md
Normal file
@ -0,0 +1,49 @@
|
||||
# Building for release
|
||||
|
||||
## Build Helper workflow
|
||||
|
||||
Our release builds are managed by the "Build Helper" GitHub Action, which is defined
|
||||
in [`build-helper.yml`](../../.github/workflows/build-helper.yml).
|
||||
|
||||
Under the hood, this will call the `package` task in
|
||||
[`Taskfile.yml`](../../Taskfile.yml), which will build the Electron codebase using
|
||||
WebPack and then the `wavesrv` and `mshell` binaries, then it will call `electron-builder`
|
||||
to generate the distributable app packages. The configuration for `electron-builder`
|
||||
is [`electron-builder.config.cjs`](../../electron-builder.config.cjs).
|
||||
|
||||
This will also sign and notarize the macOS app package.
|
||||
|
||||
Once a build is complete, it will be placed in `s3://waveterm-github-artifacts/staging-w2/<version>`.
|
||||
It can be downloaded for testing using the [`download-staged-artifact.sh`](./download-staged-artifact.sh)
|
||||
script. When you are ready to publish the artifacts to the public release feed, use the
|
||||
[`publish-from-staging.sh`](./publish-from-staging.sh) script to directly copy the artifacts from
|
||||
the staging bucket to the releases bucket.
|
||||
|
||||
## Automatic updates
|
||||
|
||||
Thanks to `electron-updater`, we are able to provide automatic app updates for macOS and Linux,
|
||||
as long as the app was distributed as a DMG, AppImage, RPM, or DEB file.
|
||||
|
||||
With each release, `latest-mac.yml`, `latest-linux.yml`, and `latest-linux-arm64.yml` files will be produced that point to the
|
||||
newest release. These also include file sizes and checksums to aid in validating the packages. The app
|
||||
will check these files in our S3 bucket every hour to see if a new version is available.
|
||||
|
||||
### Homebrew
|
||||
|
||||
Homebrew is automatically bumped when new artifacts are published.
|
||||
|
||||
### Linux
|
||||
|
||||
We do not currently submit the Linux packages to any of the package repositories. We
|
||||
are working on addressing this in the near future.
|
||||
|
||||
## `electron-build` configuration
|
||||
|
||||
Most of our configuration is fairly standard. The main exception to this is that we exclude
|
||||
our Go binaries from the ASAR archive that Electron generates. ASAR files cannot be executed
|
||||
by NodeJS because they are not seen as files and therefore cannot be executed via a Shell
|
||||
command. More information can be found
|
||||
[here](https://www.electronjs.org/docs/latest/tutorial/asar-archives#executing-binaries-inside-asar-archive).
|
||||
|
||||
We also exclude most of our `node_modules` from packaging, as WebPack handles packaging
|
||||
of any dependencies for us. The one exception is `monaco-editor`.
|
16
scripts/artifacts/download-staged-artifact.sh
Normal file
16
scripts/artifacts/download-staged-artifact.sh
Normal file
@ -0,0 +1,16 @@
|
||||
# Downloads the artifacts for the specified version from the staging bucket for local testing.
|
||||
# Usage: download-staged-artifact.sh <version>
|
||||
# Example: download-staged-artifact.sh 0.1.0
|
||||
|
||||
# Retrieve version from the first argument
|
||||
VERSION=$1
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Usage: $0 <version>"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Download the artifacts for the specified version from the staging bucket
|
||||
DOWNLOAD_DIR=$VERSION-staged
|
||||
rm -rf $DOWNLOAD_DIR
|
||||
mkdir -p $DOWNLOAD_DIR
|
||||
aws s3 cp s3://waveterm-github-artifacts/staging-w2/$VERSION/ $DOWNLOAD_DIR/ --recursive --profile $AWS_PROFILE
|
21
scripts/artifacts/publish-from-staging.sh
Normal file
21
scripts/artifacts/publish-from-staging.sh
Normal file
@ -0,0 +1,21 @@
|
||||
# Takes a release from our staging bucket and publishes it to the public download bucket.
|
||||
# Usage: publish-from-staging.sh <version>
|
||||
# Example: publish-from-staging.sh 0.1.0
|
||||
|
||||
# Takes the version as an argument
|
||||
VERSION=$1
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Usage: $0 <version>"
|
||||
exit
|
||||
fi
|
||||
|
||||
ORIGIN="waveterm-github-artifacts/staging-w2/$VERSION/"
|
||||
DESTINATION="dl.waveterm.dev/releases-w2/"
|
||||
|
||||
OUTPUT=$(aws s3 cp s3://$ORIGIN s3://$DESTINATION --recursive --profile $AWS_PROFILE)
|
||||
|
||||
for line in $OUTPUT; do
|
||||
PREFIX=${line%%${DESTINATION}*}
|
||||
SUFFIX=${line:${#PREFIX}}
|
||||
echo "https://$SUFFIX"
|
||||
done
|
Loading…
Reference in New Issue
Block a user