Skip to content

Commit

Permalink
Updates CI process (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
TAGraves authored Jun 24, 2024
1 parent 6494eb9 commit 6c28a49
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 104 deletions.
36 changes: 0 additions & 36 deletions .mint/bigtest.yml

This file was deleted.

36 changes: 24 additions & 12 deletions .mint/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
on:
github:
push:
init:
commit-sha: ${{ event.git.sha }}
ref: ${{ event.git.ref }}

concurrency-pools:
- id: rwx-research/mint-cli:pr-${{ init.ref }}
capacity: 1
on-overflow: cancel-running

tasks:
- key: code
call: mint/git-clone 1.2.4
with:
preserve-git-dir: "true"
repository: git@github.com:rwx-research/mint-cli.git
ref: ${{ init.commit }}
ssh-key: ${{ secrets.CHECKOUT_SSH_KEY_MINT_CLI_REPO }}
preserve-git-dir: true
repository: https://github.com/rwx-research/mint-cli.git
ref: ${{ init.commit-sha }}
github-access-token: ${{ github.token }}

- key: tool-versions
use: code
Expand Down Expand Up @@ -35,18 +47,18 @@ tasks:
use: go-deps
run: |
CGO_ENABLED=0 \
LDFLAGS="-w -s -X github.com/rwx-research/mint-cli/cmd/mint/config.Version=testing-${{ init.commit }}" \
LDFLAGS="-w -s -X github.com/rwx-research/mint-cli/cmd/mint/config.Version=testing-${{ init.commit-sha }}" \
go run ./tools/mage test
- key: build-mint-cli
- key: mint-cli
use: go-deps
run: |
CGO_ENABLED=0 \
LDFLAGS="-w -s -X github.com/rwx-research/mint-cli/cmd/mint/config.Version=testing-${{ init.commit }}" \
LDFLAGS="-w -s -X github.com/rwx-research/mint-cli/cmd/mint/config.Version=testing-${{ init.commit-sha }}" \
go run ./tools/mage build
- key: integration-tests
use: build-mint-cli
use: mint-cli
run: ./mint run --debug -f test/hello-world.mint.yaml
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
Expand All @@ -61,24 +73,24 @@ tasks:
go mod tidy
git diff --exit-code
- key: checkout-mint-testing
- key: mint-testing-code
call: mint/git-clone 1.2.4
with:
path: ./mint-testing
repository: https://github.com/rwx-research/mint-testing.git
ref: main
github-access-token: ${{ github.token }}

- key: install-jq
- key: jq
run: |
sudo apt-get update
sudo apt-get install jq
sudo apt-get clean
- key: run-mint-testing-tests
use: [checkout-mint-testing, install-jq, build-mint-cli]
use: [mint-testing-code, jq, mint-cli]
run: |
initiate_run_result=$(./mint run --json --file ./mint-testing/.mint/trigger-integration-test.yml --init 'grep=@cli' --init ref=main --init cli=${{ init.commit }})
initiate_run_result=$(./mint run --json --file ./mint-testing/.mint/trigger-integration-test.yml --init 'grep=@cli' --init ref=main --init cli=${{ init.commit-sha }})
echo "${initiate_run_result}"
run_id=$(echo "${initiate_run_result}" | jq -r ".RunId")
Expand Down
5 changes: 0 additions & 5 deletions .mint/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ tasks:
init:
commit: ${{ init.commit-sha }}

- key: bigtest
call: ${{ run.mint-dir }}/bigtest.yml
init:
commit-sha: ${{ init.commit-sha }}

- key: release-unstable
after: [ci, bigtest]
call: ${{ run.mint-dir }}/release.yml
Expand Down
28 changes: 0 additions & 28 deletions .mint/pull-request.yml

This file was deleted.

39 changes: 21 additions & 18 deletions .mint/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ tasks:
call: mint/git-clone 1.2.4
after: verify-inputs
with:
preserve-git-dir: "true"
repository: git@github.com:rwx-research/mint-cli.git
preserve-git-dir: true
repository: https://github.com/rwx-research/mint-cli.git
ref: ${{ init.commit }}
ssh-key: ${{ secrets.CHECKOUT_SSH_KEY_MINT_CLI_REPO }}
github-access-token: ${{ vaults.default.github-apps.rwx-bot.token }}

- key: go-deps
use: [go, code]
Expand All @@ -64,7 +64,7 @@ tasks:
- go.mod
- go.sum

- key: install-gh-cli
- key: gh-cli
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
Expand All @@ -73,7 +73,7 @@ tasks:
&& sudo apt-get install gh
- key: ensure-release-not-published
use: [install-gh-cli, code]
use: [gh-cli, code]
run: |
release_not_published=$(gh release view ${{ tasks.extract-version-details.values.full-version }} \
--json isDraft \
Expand All @@ -84,10 +84,11 @@ tasks:
exit 1
fi
env:
GH_TOKEN: ${{ secrets.MINT_CLI_REPO_GH_TOKEN }}
GITHUB_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
GH_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}

- key: draft-full-version-release
use: [install-gh-cli, code]
use: [gh-cli, code]
after: [extract-version-details, ensure-release-not-published]
run: |
full_version="${{ tasks.extract-version-details.values.full-version }}"
Expand All @@ -101,22 +102,22 @@ tasks:
--generate-notes \
--title "Mint CLI ${full_version}"
env:
GH_TOKEN: ${{ secrets.MINT_CLI_REPO_GH_TOKEN }}
GIT_SSH_KEY: ${{ secrets.CHECKOUT_SSH_KEY_MINT_CLI_REPO }}
GITHUB_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
GH_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}

- key: setup-codesigning
- key: codesigning
run: |
curl -fsSLO https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz
tar xzvf apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz --strip-components=1
- key: install-zip
- key: zip
run: |
sudo apt-get update
sudo apt-get install zip
sudo apt-get clean
- key: build-and-upload-binaries
use: [install-gh-cli, setup-codesigning, install-zip, code, go-deps]
use: [gh-cli, codesigning, zip, code, go-deps]
after: [draft-full-version-release, extract-version-details]
parallel:
key: build-and-upload-${{ parallel.os }}-${{ parallel.arch }}-binaries
Expand Down Expand Up @@ -174,24 +175,26 @@ tasks:
mv "mint$extension" "$github_asset_name"
gh release upload ${{ tasks.extract-version-details.values.full-version }} "${github_asset_name}" --clobber
env:
GH_TOKEN: ${{ secrets.MINT_CLI_REPO_GH_TOKEN }}
GITHUB_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
GH_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
CODESIGN_VERSION: 0.22.0
RWX_APPLE_DEVELOPER_ID_APPLICATION_CERT: "${{ secrets.RWX_APPLE_DEVELOPER_ID_APPLICATION_CERT_CERTIFICATE }}${{ secrets.RWX_APPLE_DEVELOPER_ID_APPLICATION_CERT_PRIVATE_KEY }}"
RWX_APPLE_APP_STORE_CONNECT_API_KEY: ${{ secrets.RWX_APPLE_APP_STORE_CONNECT_API_KEY }}

- key: publish-production-release
use: [install-gh-cli, code]
use: [gh-cli, code]
after: [extract-version-details, build-and-upload-binaries]
if: ${{ init.kind == "production" }}
run: |
gh release edit ${{ tasks.extract-version-details.values.full-version }} \
--draft=false \
--latest
env:
GH_TOKEN: ${{ secrets.MINT_CLI_REPO_GH_TOKEN }}
GITHUB_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
GH_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}

- key: update-aliased-version-release
use: [install-gh-cli, code]
use: [gh-cli, code]
after:
- extract-version-details
- ensure-release-not-published
Expand All @@ -215,5 +218,5 @@ tasks:
gh release download ${{ tasks.extract-version-details.values.full-version }}
gh release upload "${aliased_version}" mint-* --clobber
env:
GH_TOKEN: ${{ secrets.MINT_CLI_REPO_GH_TOKEN }}
GIT_SSH_KEY: ${{ secrets.CHECKOUT_SSH_KEY_MINT_CLI_REPO }}
GITHUB_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
GH_TOKEN: ${{ vaults.default.github-apps.rwx-bot.token }}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
:globe_with_meridians: [rwx.com/mint](https://www.rwx.com/mint)  
:bird: [@rwx_research](https://twitter.com/rwx_research)  
:speech_balloon: [discord](https://discord.gg/h4ha5Cue7j)  
:books: [documentation](https://www.rwx.com/docs/mint)
🌐: [rwx.com/mint](https://www.rwx.com/mint)  
✖️: [@rwx_research](https://twitter.com/rwx_research)  
💬: [discord](https://discord.gg/h4ha5Cue7j)  
📚: [documentation](https://www.rwx.com/docs/mint)

Mint is a new language-agnostic build tool designed to
substantially accelerate engineering feedback loops and lower CI costs.

Mint is currently in closed beta. Learn more at [rwx.com/mint](https://www.rwx.com/mint).
Learn more and sign up for Mint for free today at [rwx.com/mint](https://www.rwx.com/mint).

## Getting Started

Expand Down

0 comments on commit 6c28a49

Please sign in to comment.