Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build & Sign Automation #8192

Merged
merged 5 commits into from
Oct 7, 2024
Merged

Conversation

jfx2006
Copy link
Member

@jfx2006 jfx2006 commented Sep 30, 2024

Build and signing automation.

Currently, there is a flaw in that it's set to be run on a "workflow_dispatch" trigger. That only works with the primary branch. A different trigger will be needed to use a beta or release branch.**

Requirements:

  • Build variables environment:
    These are non-sensitive variables that configure the different builds needed. It is named (currently) based on an input to the workflow dispatch. That won't work probably, so something else is needed.
    • APP_NAME: app-thunderbird | app-k9
    • RELEASE_TYPE: debug | daily | beta | release
    • MATRIX_INCLUDE:
      This is a JSON string used to create the jobs matrix. For example, for Thunderbird beta, the (YAML) value would be:
      - packageFormat: bundle
        packageFlavor: full
      - packageFormat: apk
        packageFlavor: foss
      That would build bundleFullBeta and assembleFossBeta.
  • Secrets environments:
    An "upload" secret environment and a "signing" secret environment are needed. Currently the environment names are based on the appName, releaseType, and packageFlavor. So app-thunderbird_beta_full which would have the upload signing configuration for Thunderbird Beta set up. This could be improved.
    The secrets themselves are from https://github.com/noriban/sign-android-release:
          signingKey: ${{ secrets.SIGNING_KEY }}
          alias: ${{ secrets.KEY_ALIAS }}
          keyPassword: ${{ secrets.KEY_PASSWORD }}
          keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}

@jfx2006 jfx2006 marked this pull request as draft September 30, 2024 22:41
Copy link
Member

@kewisch kewisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think once the workflow has been dispatched once, we could use gh with the --ref argument to run on a specific branch. But certainly it would be easier to trigger this from the web.

Do we have any options aside from the workflow dispatch?

packageFlavor:
description: Package flavor
required: true
default: "foss"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should be full, ideally we want all features to be included by default.

description: Release Type
required: true
default: "debug"
signingKey:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be on the safe side, you might want to use add-mask on the signingKey, so it isn't inadvertently exposed.

description: key password
required: true
keyStorePassword:
description: key store password
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

.github/actions/sign_mobile/action.yml Outdated Show resolved Hide resolved
.github/workflows/shippable_builds.yml Outdated Show resolved Hide resolved
.github/workflows/shippable_builds.yml Outdated Show resolved Hide resolved
@jfx2006
Copy link
Member Author

jfx2006 commented Oct 1, 2024

I think once the workflow has been dispatched once, we could use gh with the --ref argument to run on a specific branch. But certainly it would be easier to trigger this from the web.

Do we have any options aside from the workflow dispatch?

Actually, workflow_dispatch may work out. I misunderstood the docs before:
"This event will only trigger a workflow run if the workflow file is on the default branch." -- but it triggers against a specific branch or tag.

@jfx2006
Copy link
Member Author

jfx2006 commented Oct 2, 2024

This actually builds and signs.
Everything is now in a single workflow since having separate files turned into a mess when dealing with multiple branches.

Need to test workflow_dispatch against the beta branch, it can be done apparently. The workflow file just needs to exist on the branch in question.

@jfx2006 jfx2006 force-pushed the release_automation branch from a07fb61 to 7b16bfd Compare October 4, 2024 17:54
@jfx2006 jfx2006 force-pushed the release_automation branch from 0732088 to 7c24bc5 Compare October 5, 2024 02:48
@jfx2006 jfx2006 force-pushed the release_automation branch from 7c24bc5 to 41524d2 Compare October 5, 2024 19:11
@jfx2006 jfx2006 marked this pull request as ready for review October 5, 2024 21:44
@jfx2006
Copy link
Member Author

jfx2006 commented Oct 5, 2024

Latest run on fork repo using a branch named "TB_BETA_8.0": https://github.com/jfx2006/thunderbird-android-ci/actions/runs/11195559719

I've set up the different environments necessary for doing a beta release as well. It's semi-scripted using the GitHub CLI - I'll get that cleaned up and file a PR this week so creating the release branch environments will be easier.

VersionName & VersionCode bumps and Play Store upload are next up.

Copy link
Member

@kewisch kewisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to approve this now and we'll see how well it works to build and sign the release.

.github/workflows/shippable_builds.yml Outdated Show resolved Hide resolved
strategy:
matrix:
include: "${{ fromJSON(needs.dump_config.outputs.matrixInclude) }}"
environment: ${{ needs.dump_config.outputs.appName }}_${{ needs.dump_config.outputs.releaseType }}_${{ matrix.packageFlavor }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use ${{ needs.get_environment.outputs.releaseEnv }} here and depend on get_environment as well?

@kewisch
Copy link
Member

kewisch commented Oct 7, 2024

Lint and build is done, I'm going to go ahead and merge as tests shouldn't be affected by this CI and previous commits have succeeded.

@kewisch kewisch merged commit 11e6d54 into thunderbird:main Oct 7, 2024
2 of 3 checks passed
token: ${{ steps.app-token.outputs.token }}
target_commitish: ${{ github.sha }}
tag_name: ${{ env.TAG_NAME }}
fail_on_unmatched_files: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add draft: true so the release notes can be added by a human and then the release is published.

Now the release emails I receive have no notes, please fix this 😢

@jfx2006 jfx2006 deleted the release_automation branch October 29, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants