* feat: Use hybrid approach depending on runner * Fix tag * Update dist * Add fetch depth to test * Add dependcy on docker-build job for test action * Improve branch extraction naming, add npm scripts to bump docker tags * Pass inputs along * Run tests on workflow_run completed * Update workflow run trigger * Fix fetch-depth * Update comment * Update workflow naming * Update workflow names * Merge test.yml into build.yml to run tests after building * Always install node/npm on non Linux runners, update development docs * Fail the job if docker tag matches MAJOR.MINOR.PATCH naming * Some cleanup * Test with major.minor.patch tag * Rework error message * Update development doc * Add logic to commit `master` docker tag on master runs * Allow linting in parallel * Add pre-commit to the repo * Add Makefile to install pre-commit and yarrn deps * Skip pre-commit in action when committing the master tag back * Add note on `yarn set-docker-tag-from-branch` to development doc * Add formatting and linting to pre-commit * Mark e2e tests in build.yml better * Don't pass filenames to local hooks, fix dockerfile casing * Add changelog
3.0 KiB
Pre-requirements
This setup assumes you have [Yarn][Yarn], [Volta][volta] and [pre-commit][pre-commit] installed.
After cloning the repo, run
# Install or update application dependencies
make
Development of getsentry/action-release
This document aims to provide guidelines for maintainers and contains information on how to develop and test this action. For info on how to release changes, follow publishing-a-release.
The action is a composite GitHub Action.
On Linux runners, the action executes the underlying JavaScript script via a Docker image we publish.
For Mac OS and Windows runners, the action cannot run the Docker image and instead installs
the @sentry/cli dependency corresponding to the architecture of the runner and then executes the underlying JavaScript
distribution.
This split in architecture is done to optimize the run-time of the action but at the same time support non-Linux runners.
This action runs fastest on Linux runners.
Development
The action is using @sentry/cli under the hood and is written in TypeScript. See src/main.ts to get started.
Options to the action are exposed via action.yml, changes that impact options need to be documented in the README.md.
Note
Actions have to be exposed in 3 places in
action.yml
- Under the
inputsfield - These are the actual inputs exposed to users- Under the
envfield inside theRun docker imagestep. All inputs have to be mapped from inputs toINPUT_Xenv variables.- Under the
envfield inside the `Run Release Action
Telemetry for internal development is collected using @sentry/node, see src/telemetry.ts for utilities.
Development steps
Note
Contributors will need to create an internal integration in their Sentry org and need to be an admin. See #Prerequisites.
Members of this repo will not have to set anything up since the integration is already set-up. Just open the PR and you will see a release created for your PR.
- Create a branch
- Run
yarn set-docker-tag-from-branchto set a docker tag based on your github branch name. This is important so that the action gets its own Docker image, allowing you to test the action in a different repo. - Make changes
- If possible, add unit and E2E tests (inside
.github/workflows/build.yml) - Run
yarn installto install deps - Run
yarn buildto build the action - Commit the changes and the build inside
dist/
If you forget to run yarn set-docker-tag-from-branch the repo's pre-commit hooks will do it for you and fail the commit.
Just add the changes to staging and commit again.
Testing
You can run unit tests with yarn test.
Troubleshooting
- If the
verify-distaction fails for your PR, you likely forgot to commit the build output. Runyarn installandyarn buildand commit thedist/folder.