Skip to content

Better taskcluster-gha branching #9

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

Merged
merged 10 commits into from
Mar 1, 2024
Merged

Conversation

dylanhand
Copy link
Contributor

@dylanhand dylanhand commented Mar 1, 2024

Improve using branches with taskcluster-gha.

Currently it's possible to use a branch, but it's a bit of a hack and only works if the branch is specified in the very first call to a given taskcluster-gha repo.

This PR makes it possible to specify a branch on a per-gha call basis. This means multiple branches of the same taskcluster-gha repo may be used at the same time.

Usage looks like this:

...
# Since no branch is specified in the `GithubAction` below, `main` will be used
.with_gha(
    "bundler",
    GithubAction(
        "divvun/taskcluster-gha/speller/bundle",
        {
            "speller-type": type_,
            "speller-manifest-path": "manifest.toml",
            "speller-paths": "${{ steps.build_spellers.outputs['speller-paths'] }}",
            "version": "${{ steps.version.outputs.version }}",
        },
    ).with_outputs_from(lang_task_id),
)
# This action will use the `windows-codesign` branch
.with_gha(
    "codesign",
    GithubAction(
        "divvun/taskcluster-gha/codesign",
        { "path": "${{ steps.bundler.outputs['payload-path'] }}" },
        # TODO: remove branch when done developing
        branch="windows-codesign",
    ),
)
# This action will use the `other-branch` branch
.with_gha(
    "deploy",
    GithubAction(
        "divvun/taskcluster-gha/speller/deploy",
        {
            "speller-type": type_,
            "speller-manifest-path": "manifest.toml",
            "payload-path": "${{ steps.codesign.outputs['signed-path'] }}",
            "version": "${{ steps.version.outputs.version }}",
            "channel": "${{ steps.version.outputs.channel }}",
            "repo": "https://pahkat.uit.no/main/",
            "nightly-channel": NIGHTLY_CHANNEL,
        },
        # TODO: remove branch when done developing
        branch="windows-codesign",
    ),
)
...

@dylanhand dylanhand marked this pull request as ready for review March 1, 2024 05:36
@dylanhand dylanhand changed the title Better branching Better taskcluster-gha branching Mar 1, 2024
@dylanhand dylanhand merged commit 01179e5 into windows-codesign Mar 1, 2024
@dylanhand dylanhand deleted the better-branching branch March 1, 2024 05:49
dylanhand added a commit that referenced this pull request Apr 11, 2024
* Add codesign step to lang-task and temporarily disable deploy

* Try another way to use taskcluster-gha branch

* Try using branch another way

* Make sure using a branch is working

* Oh man if this makes the branch work

Theory is that it's not downloading the specified branch of this repo because it's already downloaded the `main` branch earlier so it's in the list of already-downloaded repos. Hopefully specifying branch in the *first* reference to this GHA repo will fix the issue. If it does, this needs to be refactored to be less esoteric.

* See what it looks like on the other side

* Revert "See what it looks like on the other side"

This reverts commit 6667082.

* Remove extra branch call

When using the same gha, the branch is only considered on the first call to that gha url.

* Running out of ideas

* Revert "Running out of ideas"

This reverts commit 6275874.

* Going crazy

* Revert "Going crazy"

This reverts commit 93fec9f.

* See if this branch breaks Mac builds

* Revert "See if this branch breaks Mac builds"

This reverts commit bd7d551.

* Try sending signed output to deploy action

* Better `taskcluster-gha` branching (#9)

* Try making branches more robust

Change action_path and log

* Attempt to fix allowing multiple branches for gha

* Call new test action for faster testing

* Revert "Attempt to fix allowing multiple branches for gha"

This reverts commit 6b14efa.

* Revert "Try making branches more robust"

This reverts commit cc3aca2.

* Attempt to allow using github actions from different branches

* Specify branch from within GithubAction as we discussed

* Yes, here too

* Gotta do this lil guy from a branch as well now

* Remove test action

* Add instructions for developing using branches

* Add codesign step to keyboard task

* Forgot to point to branch

* Remove prints and branch references
dylanhand added a commit that referenced this pull request Apr 11, 2024
* Try making branches more robust

Change action_path and log

* Attempt to fix allowing multiple branches for gha

* Call new test action for faster testing

* Revert "Attempt to fix allowing multiple branches for gha"

This reverts commit 6b14efa.

* Revert "Try making branches more robust"

This reverts commit cc3aca2.

* Attempt to allow using github actions from different branches

* Specify branch from within GithubAction as we discussed

* Yes, here too

* Gotta do this lil guy from a branch as well now

* Remove test action
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.

1 participant