-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate pipeline from CircleCI to GitHub Actions #218
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| name: Main | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install tools | ||
| uses: infrablocks/github-actions/asdf_install@v1 | ||
| - name: Check | ||
| run: ./go library:check | ||
| - name: Notify Slack | ||
| if: ${{ !cancelled() }} | ||
| continue-on-error: true | ||
| run: ./go "slack:notify[${{ job.status }}]" | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install tools | ||
| uses: infrablocks/github-actions/asdf_install@v1 | ||
| - name: Test | ||
| run: ./go test:unit | ||
| - name: Notify Slack | ||
| if: ${{ !cancelled() }} | ||
| continue-on-error: true | ||
| run: ./go "slack:notify[${{ job.status }}]" | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
|
||
| prerelease: | ||
| needs: [check, test] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| # Job-level group (here and on release): a run awaiting release approval | ||
| # holds the slot, and a workflow-level group would freeze all main CI for | ||
| # the approval window. queue: max keeps every queued run; the default | ||
| # cancels all but the newest. | ||
| concurrency: | ||
| group: main | ||
| cancel-in-progress: false | ||
| queue: max | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install tools | ||
| uses: infrablocks/github-actions/asdf_install@v1 | ||
| - name: Install secrets tools | ||
| run: ./scripts/ci/common/install-git-crypt.sh | ||
| - name: Unlock git-crypt | ||
| run: ./go git_crypt:unlock_with_encrypted_gpg_key | ||
| env: | ||
| ENCRYPTION_PASSPHRASE: ${{ secrets.ENCRYPTION_PASSPHRASE }} | ||
| - name: Configure RubyGems credentials | ||
| run: ./scripts/ci/common/configure-rubygems.sh | ||
| - name: Set CI git author | ||
| run: ./go repository:set_ci_author | ||
| - name: Bump version | ||
| run: ./go "version:bump[pre]" | ||
| - name: Release | ||
| run: ./go release | ||
| - name: Push commits | ||
| run: git push | ||
| - name: Push tags | ||
| run: git push --tags | ||
| - name: Notify Slack of release hold | ||
| continue-on-error: true | ||
| run: ./go "slack:notify[success,on_hold]" | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
| - name: Notify Slack | ||
| if: ${{ !cancelled() }} | ||
| continue-on-error: true | ||
| run: ./go "slack:notify[${{ job.status }}]" | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
|
||
| release: | ||
| needs: [prerelease] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| environment: release | ||
| concurrency: | ||
| group: main | ||
| cancel-in-progress: false | ||
| queue: max | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: main | ||
| - name: Pull latest main | ||
| # Publishes main as of approval time, not the SHA that triggered the | ||
| # run; --ff-only so a non-fast-forward fails loudly | ||
| run: git pull --ff-only | ||
| - name: Install tools | ||
| uses: infrablocks/github-actions/asdf_install@v1 | ||
| - name: Install secrets tools | ||
| run: ./scripts/ci/common/install-git-crypt.sh | ||
| - name: Unlock git-crypt | ||
| run: ./go git_crypt:unlock_with_encrypted_gpg_key | ||
| env: | ||
| ENCRYPTION_PASSPHRASE: ${{ secrets.ENCRYPTION_PASSPHRASE }} | ||
| - name: Configure RubyGems credentials | ||
| run: ./scripts/ci/common/configure-rubygems.sh | ||
| - name: Set CI git author | ||
| run: ./go repository:set_ci_author | ||
| - name: Bump version | ||
| run: ./go "version:bump[minor]" | ||
| - name: Release | ||
| run: ./go release | ||
| - name: Push commits | ||
| run: git push | ||
| - name: Push tags | ||
| run: git push --tags | ||
| - name: Notify Slack | ||
| if: ${{ !cancelled() }} | ||
| continue-on-error: true | ||
| run: ./go "slack:notify[${{ job.status }}]" | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🔵 Safety — plan concern (§1 parity, D5 inherited hazard; not blocking)
./go releasepushes the gem to RubyGems before the subsequentgit push/git push --tagssteps. If the push fails (e.g.mainadvanced during the run) the version is already published and irreversible, but no matching commit/tag exists in the repo, and the next run collides on the version. Inherited from the untouched./go releaselogic and explicitly flagged as deliberate; a fleet-wide reorder is post-migration work.