Closed jonrkarr closed 3 years ago
Bot account
Hi @jonrkarr
Would it be possible to add the sbrg-machine-user as a bot account for this purpose?
Yes, it can be any GitHub account. I can give permissions to that account. You'll need to accept the GitHub invitation.
We also use machine accounts for similar purposes.
Here's a preview of what publishing a MASS model will look like. Note, BioSimulations is still a work in progress.
https://biosimulations.org/projects/RBC-metabolism-Bordbar-Cell-Syst-2015
How can I generate the token? Alternatively, could it be emailed to me or the bot account?
Much appreciated :)
GitHub tokens have to be generated by users. This can be done at https://github.com/settings/tokens while logged into GitHub as sbrg-machine-user
account. When you create the token, grant it the repo
"scope". Scopes are permissions granted to the token.
The token can then be stored as a "secret" as outlined above. The secrets can be stored here https://github.com/SBRG/MASSpy/settings/secrets/actions. Secrets are GitHub's mechanism to store passwords for actions without embedding them into repositories. This allows the secret to be private, while the repository is public. Secrets can they be used similarly to environment variables in GitHub actions.
"Secrets"
BIOSIMULATORS_GH_USERNAME
: sbrg-machine-user
BIOSIMULATORS_GH_TOKEN
: {new token that you create}
Oh! Those tokens, I thought you were talking about something biosimulators specific.
Thanks!
Sorry that wasn't clear. Because nearly all systems biology software projects are being developed in GitHub, it seemed easiest to leverage existing accounts.
No worries! That's what the bot account is for anyways, plus I also see now that I misread the original message XD
@jonrkarr let me know if this works!
The action failed due to insufficient permissions. I corrected the permissions. Could you try again?
One thing we find convenient for testing workflows is adding a "workflow dispatch" option. This provides the ability to click a button in the GitHub website to trigger the workflow, in addition to the other event-based triggers. Adding workflow_dispatch:
to the action (see below) would give you a button ("Run workflow") to trigger the workflow here: https://github.com/SBRG/MASSpy/actions/workflows/biosimulators_dispatch.yml. This would let you run the workflow separate from creating a new GitHub release.
Add to workflow dispatch:
to .github/workflows/biosimulators_dispatch.yml
:
...
on:
release:
types:
- published
workflow_dispatch:
...
Added in the dispatch and reran the workflow
The workflow ran. I think the issue can be closed now.
To keep the version of MASSpy in BioSimulators up to date, we recommend automating the release of new versions to BioSimulators. This can be done using the GitHub API, such as using the action step below.
Two repository "secrets" need to be added to use the action:
BIOSIMULATORS_GH_USERNAME
: the name of the GitHub user who pushes MASSpy to BioSimulators (e.g.,z-haiman
).z-haiman
already has permissions for this. If you prefer to use a bot account, let us know the name so we can grant permissions.BIOSIMULATORS_GH_TOKEN
: token forBIOSIMULATORS_GH_USERNAME
. The token needs to have the scoperepo
.This will trigger a CI action on BioSimulators_MASSpy which will test the interface and build a Docker image. Depending on the order in which you release to PyPI and BioSimulators, we may need to make minor changes to this downstream action because there's typically a short delay because PyPI packages are available.