Skip to content

Commit ced26ff

Browse files
authored
Migrate the Drone release steps to GitHub Actions (#3606)
1 parent 722b458 commit ced26ff

10 files changed

+203
-394
lines changed

.drone/drone.jsonnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ local pipelines = import './pipelines.jsonnet';
33
(import 'pipelines/test.jsonnet') +
44
(import 'pipelines/check_containers.jsonnet') +
55
(import 'pipelines/crosscompile.jsonnet') +
6-
(import 'pipelines/publish.jsonnet') +
76
(import 'util/secrets.jsonnet').asList

.drone/drone.yml

Lines changed: 1 addition & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -244,151 +244,6 @@ trigger:
244244
- pull_request
245245
type: docker
246246
---
247-
kind: pipeline
248-
name: Publish Linux alloy container
249-
platform:
250-
arch: amd64
251-
os: linux
252-
steps:
253-
- commands:
254-
- git fetch --tags
255-
image: grafana/alloy-build-image:v0.1.19
256-
name: Fetch tags
257-
- commands:
258-
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
259-
failure: ignore
260-
image: grafana/alloy-build-image:v0.1.19
261-
name: Configure QEMU
262-
volumes:
263-
- name: docker
264-
path: /var/run/docker.sock
265-
- commands:
266-
- mkdir -p $HOME/.docker
267-
- printenv GCR_CREDS > $HOME/.docker/config.json
268-
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
269-
- docker buildx create --name multiarch-alloy-alloy-${DRONE_COMMIT_SHA} --driver
270-
docker-container --use
271-
- ./tools/ci/docker-containers alloy
272-
- docker buildx rm multiarch-alloy-alloy-${DRONE_COMMIT_SHA}
273-
environment:
274-
DOCKER_LOGIN:
275-
from_secret: docker_login
276-
DOCKER_PASSWORD:
277-
from_secret: docker_password
278-
GCR_CREDS:
279-
from_secret: gcr_admin
280-
image: grafana/alloy-build-image:v0.1.19
281-
name: Publish container
282-
volumes:
283-
- name: docker
284-
path: /var/run/docker.sock
285-
trigger:
286-
ref:
287-
- refs/tags/v*
288-
type: docker
289-
volumes:
290-
- host:
291-
path: /var/run/docker.sock
292-
name: docker
293-
---
294-
kind: pipeline
295-
name: Publish Linux alloy-boringcrypto container
296-
platform:
297-
arch: amd64
298-
os: linux
299-
steps:
300-
- commands:
301-
- git fetch --tags
302-
image: grafana/alloy-build-image:v0.1.19
303-
name: Fetch tags
304-
- commands:
305-
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
306-
failure: ignore
307-
image: grafana/alloy-build-image:v0.1.19
308-
name: Configure QEMU
309-
volumes:
310-
- name: docker
311-
path: /var/run/docker.sock
312-
- commands:
313-
- mkdir -p $HOME/.docker
314-
- printenv GCR_CREDS > $HOME/.docker/config.json
315-
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
316-
- docker buildx create --name multiarch-alloy-alloy-boringcrypto-${DRONE_COMMIT_SHA}
317-
--driver docker-container --use
318-
- ./tools/ci/docker-containers alloy-boringcrypto
319-
- docker buildx rm multiarch-alloy-alloy-boringcrypto-${DRONE_COMMIT_SHA}
320-
environment:
321-
DOCKER_LOGIN:
322-
from_secret: docker_login
323-
DOCKER_PASSWORD:
324-
from_secret: docker_password
325-
GCR_CREDS:
326-
from_secret: gcr_admin
327-
image: grafana/alloy-build-image:v0.1.19
328-
name: Publish container
329-
volumes:
330-
- name: docker
331-
path: /var/run/docker.sock
332-
trigger:
333-
ref:
334-
- refs/tags/v*
335-
type: docker
336-
volumes:
337-
- host:
338-
path: /var/run/docker.sock
339-
name: docker
340-
---
341-
depends_on:
342-
- Publish Linux alloy container
343-
- Publish Linux alloy-boringcrypto container
344-
image_pull_secrets:
345-
- dockerconfigjson
346-
kind: pipeline
347-
name: Publish release
348-
platform:
349-
arch: amd64
350-
os: linux
351-
steps:
352-
- commands:
353-
- git fetch --tags
354-
image: grafana/alloy-build-image:v0.1.19
355-
name: Fetch tags
356-
- commands:
357-
- /usr/bin/github-app-external-token > /drone/src/gh-token.txt
358-
environment:
359-
GITHUB_APP_ID:
360-
from_secret: updater_app_id
361-
GITHUB_APP_INSTALLATION_ID:
362-
from_secret: updater_app_installation_id
363-
GITHUB_APP_PRIVATE_KEY:
364-
from_secret: updater_private_key
365-
image: us.gcr.io/kubernetes-dev/github-app-secret-writer:latest
366-
name: Generate GitHub token
367-
- commands:
368-
- export GITHUB_TOKEN=$(cat /drone/src/gh-token.txt)
369-
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
370-
- RELEASE_BUILD=1 VERSION="${DRONE_TAG}" make -j4 dist
371-
- |
372-
VERSION="${DRONE_TAG}" RELEASE_DOC_TAG=$(echo "${DRONE_TAG}" | awk -F '.' '{print $1"."$2}') ./tools/release
373-
environment:
374-
DOCKER_LOGIN:
375-
from_secret: docker_login
376-
DOCKER_PASSWORD:
377-
from_secret: docker_password
378-
image: grafana/alloy-build-image:v0.1.19
379-
name: Publish release
380-
volumes:
381-
- name: docker
382-
path: /var/run/docker.sock
383-
trigger:
384-
ref:
385-
- refs/tags/v*
386-
type: docker
387-
volumes:
388-
- host:
389-
path: /var/run/docker.sock
390-
name: docker
391-
---
392247
get:
393248
name: app-id
394249
path: infra/data/ci/agent/githubapp
@@ -456,6 +311,6 @@ kind: secret
456311
name: updater_private_key
457312
---
458313
kind: signature
459-
hmac: 97e03c7222ff8e76e82dfc902b5bfad2c608742470e01db30ad76a2bfbb49d56
314+
hmac: 64f2e8742ad821a4cfe298fd79d67a732fb99a492259cf34de8ef515dc2bec38
460315

461316
...

.drone/pipelines/publish.jsonnet

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

.github/workflows/check-linux-container.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,19 @@ permissions:
1818

1919
jobs:
2020
check-linux-container:
21-
name: Check Linux container
22-
container: grafana/alloy-build-image:v0.1.19
23-
runs-on:
24-
labels: github-hosted-ubuntu-x64-large
25-
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28-
with:
29-
persist-credentials: false
21+
uses: ./.github/workflows/publish-alloy-linux.yml
22+
permissions:
23+
contents: read
24+
id-token: write
25+
with:
26+
img-name: alloy-devel
27+
push: false
3028

31-
- name: Set ownership
32-
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
33-
run: |
34-
# this is to fix GIT not liking owner of the checkout dir
35-
chown -R $(id -u):$(id -g) $PWD
36-
37-
- name: Set up Go
38-
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
39-
with:
40-
go-version-file: go.mod
41-
cache: false
42-
43-
- run: |
44-
make alloy-image
29+
check-linux-boringcrypto-container:
30+
uses: ./.github/workflows/publish-alloy-linux.yml
31+
permissions:
32+
contents: read
33+
id-token: write
34+
with:
35+
img-name: alloy-devel-boringcrypto
36+
push: false

.github/workflows/check-windows-container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ permissions:
2424

2525
jobs:
2626
check_windows_container:
27-
uses: ./.github/workflows/publish-alloy.yml
27+
uses: ./.github/workflows/publish-alloy-windows.yml
2828
permissions:
2929
contents: read
3030
id-token: write

0 commit comments

Comments
 (0)