Skip to content

Commit 8603d7e

Browse files
authored
Merge pull request #1232 from planetscale/release-workflow
Migrate release pipeline to Actions
2 parents a09b1b0 + 7f6e191 commit 8603d7e

6 files changed

Lines changed: 45 additions & 36 deletions

File tree

.buildkite/pipeline.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
if: github.ref == 'refs/heads/main'
9+
runs-on: ubuntu-latest
10+
environment: release
11+
permissions:
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
18+
persist-credentials: true
19+
20+
- name: Configure Git
21+
run: |
22+
git config user.name "planetscale-actions-bot"
23+
git config user.email "60239337+planetscale-actions-bot@users.noreply.github.com"
24+
25+
- name: Bump version and push tag
26+
id: bump
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
29+
run: script/bump-version.sh
30+
31+
- name: Publish artifacts
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
34+
GORELEASER_CURRENT_TAG: ${{ steps.bump.outputs.RELEASE_VERSION }}
35+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
36+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
37+
AUR_KEY: ${{ secrets.AUR_KEY }}
38+
run: script/release.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PlanetScale CLI [![Build status](https://badge.buildkite.com/cf225eb6ccc163b365267fd8172a6e5bd9baa7c8fcdd10c77c.svg?branch=main)](https://buildkite.com/planetscale/cli)
1+
# PlanetScale CLI [![Build status](https://github.com/planetscale/cli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/planetscale/cli/actions/workflows/ci.yml)
22

33
PlanetScale is more than a database and our CLI is more than a jumble of commands. The `pscale` command line tool brings branches, deploy requests, and other PlanetScale concepts to your fingertips.
44

docker-compose.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

script/bump-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ curl -L -o /tmp/svu_linux_x86_64.tar.gz https://github.com/caarlos0/svu/releases
99
cd /tmp && tar -zxvf svu_linux_x86_64.tar.gz
1010
cd $WORKDIR
1111

12-
git fetch --tags
12+
git fetch --tags
1313

1414
RELEASE_VERSION=$(/tmp/svu minor)
1515

1616
echo "+++ :boom: Bumping to version $RELEASE_VERSION"
1717

1818
git config --global --add url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
1919

20-
buildkite-agent meta-data set "release-version" "$RELEASE_VERSION"
20+
echo "RELEASE_VERSION=$RELEASE_VERSION" >>"$GITHUB_OUTPUT"
2121

2222
git tag "$RELEASE_VERSION"
2323
git push origin "$RELEASE_VERSION"

script/release.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ set -eu
44

55
WORKDIR=$(pwd)
66

7-
GORELEASER_CURRENT_TAG=$(buildkite-agent meta-data get "release-version")
7+
if [ -z "${GORELEASER_CURRENT_TAG:-}" ]; then
8+
echo "error: GORELEASER_CURRENT_TAG must be set" >&2
9+
exit 1
10+
fi
811
export GORELEASER_CURRENT_TAG
912

1013
tmpdir=$(mktemp -d)

0 commit comments

Comments
 (0)