Skip to content

Commit

Permalink
documentation and further polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Neunert committed May 27, 2024
1 parent b415b00 commit dc1b8f1
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 22 deletions.
47 changes: 38 additions & 9 deletions docs/release-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,59 @@ For details look at `.gitlab-ci.yml`

## MacOS

Ideally, directly after the tag is created, start with the MacOS release. This has to be done manually, for now. There is a script for this:
Ideally, directly after the tag is created, start with the MacOS release. As the binaries of x86/arm64 are not compatible with each other, we need to build on two MacOS architectures.This has to be done manually, for now. There is a script for this. Start with the build on x86:

### MacOS x64 build

```bash
./utils/build-osx.sh --version v2.0.5-pre4 --appleid "Satoshi Nakamoto (appleid)" --mail "[email protected]" specterd package upload
```

This will create three artifacts on github:
* specterd-v2.0.5-pre4-osx_x64.zip
* SHA256SUMS-macos_x64
* SHA256SUMS-macos_x64.asc

### MacOS arm64 build

The electron application will get built on the arm architecture. As it needs to store the sha256 hash in the electron-app, the make-hash target
will not only hash the specterd but also download the other specterd and hash it.

```bash
./utils/build-osx.sh --version v1.13.1 --appleid "Satoshi Nakamoto (appleid)" --mail "[email protected]" make-hash specterd electron sign upload
./utils/build-osx.sh --version v2.0.5-pre4 --appleid "Satoshi Nakamoto (appleid)" --mail "[email protected]" specterd make-hash electron sign package upload
```

This script also runs `github.py upload `, so two more binares and the hash and signature files are uploaded to GitHub:
This will create three artifacts on github:
* Specter-v2.0.5-pre4.dmg
* specterd-v2.0.5-pre4-osx_arm64.zip
* SHA256SUMS-macos_arm64
* SHA256SUMS-macos_arm64.asc

- Specter-v1.13.1.dmg
- specterd-v1.13.1-osx.zip
- SHA256SUMS-macos
- SHA256SUMS-macos.asc

## GitLab - post releasing

Back to GitLab, the final stage is "post releasing".

In this stage, the invididual SHA256-hashes and signatures are combined into two final files:
### release_signatures

In this job, the individual SHA256-hashes and signatures are combined into two final files:

- SHA256SUMS
- SHA256SUMS.asc

Everything, apart from the MacOS files, are pulled from the GitLab environment, the MacOS files from GitHub.
Don't forget to delete the two MacOS files (`SHA256SUMS-macos` and `SHA256SUMS-macos.asc`) on the GitHub release page in the end.
Don't forget to delete the four MacOS files (`SHA256SUMS-macos_arm64` and `SHA256SUMS-macos_arm64.asc` and the two corresponding `_x64` files) on the GitHub release page in the end.

This is difficult to automate as sometimes the manual steps has not succeeded while generating the SHASUM-files. As a result, those hashes are not included. So you might want to run this again. And you can, just delete the two generated files - `SHA256SUMS` and `SHA256SUMS.asc` and run the job again.

### release_docker

There are docker images created by the awesome [Chiang Mai LN dev](https://github.com/lncm/docker-specter-desktop). So the task of this job is to trigger their build-system which is done via `utils/trigger_docker_build.sh`. A prerequisite of this is a token in order to authenticate. That token is from Aaron, one of the maintainers of that repo, and can be found in the gitlab variables section of the CI/CD configuration.

### tag_specterext_dummy_repo

Sometimes there are changes on the plugin architecture. In order to create a plugin, it's quite important to know which version of the plugin system should be used. Because of that, we simply assume that the master of the [specterext-dummy](https://github.com/cryptoadvance/specterext-dummy) repo is compatible with the current master which was just tagged with the new version.
So this job will tag that repo with the same tag and the creation of a plugin will take the version into account.

## Trouble shooting

Expand Down
10 changes: 6 additions & 4 deletions pyinstaller/electron/downloadloc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

function orgName() {
return "k9ert"
// This can be changed in order to make download possible from other github orgs
return "cryptoadvance"
}

function getDownloadLocation(version, platformname) {
if (platformname != "darwin") {
if (platformname != "osx") {
return `https://github.com/${orgName()}/specter-desktop/releases/download/${version}/specterd-${version}-${platformname}.zip`
}
return `https://github.com/${orgName()}/specter-desktop/releases/download/${version}/specterd-${version}-${platformname}_${process.arch}.zip`
Expand All @@ -15,7 +16,8 @@ function appName() {
}

module.exports = {
getDownloadLocation: getDownloadLocation,
appName: appName
getDownloadLocation,
appName,
orgName
}

6 changes: 4 additions & 2 deletions utils/build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function build_pypi_pckgs_and_install {
pip3 install ./dist/cryptoadvance.specter-*.whl
}

function specify_app_name {
echo " --> Specify app_name"
function configure {
echo " --> Configure some variables"
if [ -z "$app_name" ]; then
# activate virtualenv. This is e.g. not needed in CI
app_name=specter
Expand All @@ -48,13 +48,15 @@ function specify_app_name {
export ARCH=$(node -e "console.log(process.arch)")
export dist_mac_folder_name=mac-universal
export CI_COMMIT_TAG=$version
export CI_PROJECT_ROOT_NAMESPACE=$(node -e "const downloadloc = require('./pyinstaller/electron/downloadloc');console.log(downloadloc.orgName())")

echo specterd_filename=${specterd_filename}
echo specterimg_filename=${specterimg_filename}
echo pkg_filename=${pkg_filename}
echo ARCH=$ARCH
echo dist_mac_folder_name=$dist_mac_folder_name
echo CI_COMMIT_TAG=$CI_COMMIT_TAG
echo CI_PROJECT_ROOT_NAMESPACE=$CI_PROJECT_ROOT_NAMESPACE

}

Expand Down
7 changes: 1 addition & 6 deletions utils/build-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,6 @@ while [[ $# -gt 0 ]]
shift
shift
;;
--gh-project)
export CI_PROJECT_ROOT_NAMESPACE=$2
shift
shift
;;
specterd)
build_specterd=True
shift
Expand Down Expand Up @@ -270,7 +265,7 @@ echo " --> This build got triggered for version $version"

echo $version > pyinstaller/version.txt

specify_app_name
configure

if [[ "$build_specterd" = "True" ]]; then
create_virtualenv_for_pyinstaller
Expand Down
2 changes: 1 addition & 1 deletion utils/build-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ echo " --> This build got triggered for version $version"
# This file gets further packaged up with the pyinstaller and will help specter to figure out which version it's running on
echo $version > pyinstaller/version.txt

specify_app_name
configure

if [[ "$build_specterd" = "True" ]]; then
create_virtualenv_for_pyinstaller
Expand Down

0 comments on commit dc1b8f1

Please sign in to comment.