-
Notifications
You must be signed in to change notification settings - Fork 370
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
Conversation
8e7c08b
to
5865008
Compare
@suz-stripe You should have admin access to the repo now. |
thank you! 🙋🏼♀️ |
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
@tomer-stripe I'll add the secrets and merge today! |
* add GitHub Action for releasing the CLI * remove travis ci config
Reviewers
r? @tomer-stripe
cc @stripe/developer-products
Summary