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

Migrate release process to GitHub Actions #557

Merged
merged 2 commits into from
Jan 14, 2021

Conversation

suz-stripe
Copy link
Contributor

@suz-stripe suz-stripe commented Jan 6, 2021

Reviewers

r? @tomer-stripe
cc @stripe/developer-products

Summary

⚠️ 🚨 Before merge

  • We'll need to add to this repo all of the secrets listed in the Action workflow file (github token, docker, virustotal, bintray etc). I don't have the permissions on this repo to do that myself.

@suz-stripe suz-stripe force-pushed the suz-stripe/github-action-release branch from 8e7c08b to 5865008 Compare January 6, 2021 01:58
@ob-stripe
Copy link
Contributor

@suz-stripe You should have admin access to the repo now.

@suz-stripe
Copy link
Contributor Author

@suz-stripe You should have admin access to the repo now.

thank you! 🙋🏼‍♀️

@suz-stripe
Copy link
Contributor Author

Here is the release workflow running on a fork of the CLI: https://github.com/suz-stripe/stripe-cli/runs/1497277525?check_suite_focus=true

(FYI the docker push and bintray/virustotal steps were omitted from the fork workflow file but the other steps ran successfully)

uses: actions/checkout@v2
-
name: Run goreleaser
uses: ./.github/actions/releaser
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a dumb question for learning purposes as I'm not super familiar with docker.

I assume this will run the .github/workflows/releaser/action.yml file, which says to run .github/actions/releaser/Dockerfile? This Dockerfile seems... light, how does it know what to do? Is it github actions that is smart enough on how to handle a docker file, run it, etc?

Copy link
Contributor

Choose a reason for hiding this comment

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

ok so I see in the action that the job correctly runs /usr/bin/docker run --name mailchaingoreleaserxcgolatest_c199d2 --label 179394 --workdir /github/workspace --rm -e GORELEASER_GITHUB_TOKEN -e BUILD_PLS_DIR -e INPUT_ARGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/stripe-cli/stripe-cli":"/github/workspace" mailchain/goreleaser-xcgo:latest --rm-dist.

Where is that coming from? Is it part of the Dockerfile, or is it Github Action that is smart and knows to run this complicated command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GitHub actions knows to run the Dockerfile (you can read more here). The base image has an entrypoint and because I omitted an entrypoint in my Dockerfile it will go ahead and run the base image's which is what we want. We'll need to start using a newer version of goreleaser for #549, so I proactively did the preparation work in this PR for that. IMO this is the most low touch and low maintenance way for us to keep using goreleaser-xcgo for binary cross compilation without getting stuck on old versions of goreleaser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where is that coming from?

It's mostly the GitHub Action runtime doing all of the work such as running the container and sharing all of the environment variables needed, including the ones we specify in our workflow file for that specific step.

@stripe-ci stripe-ci assigned suz-stripe and unassigned tomer-stripe Jan 11, 2021
Copy link
Collaborator

@tomer-stripe tomer-stripe 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 +1 to shipping this and then doing some iteration to smooth it out! Let's make sure we don't have any immediate releases scheduled but otherwise go for it.

@suz-stripe
Copy link
Contributor Author

@tomer-stripe I'll add the secrets and merge today!

@suz-stripe suz-stripe merged commit 93a794c into master Jan 14, 2021
@suz-stripe suz-stripe deleted the suz-stripe/github-action-release branch January 14, 2021 22:58
az777777 pushed a commit to az777777/stripe-cli that referenced this pull request Jun 22, 2021
* add GitHub Action for releasing the CLI

* remove travis ci config
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.

None yet

4 participants