forked from crossplane/crossplane
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (62 loc) · 2.8 KB
/
promote.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Promote
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g. v0.1.0)'
required: true
channel:
description: 'Release channel'
required: true
default: 'stable'
# Note: For pre-releases, we want to promote the pre-release version to
# the (stable) channel, but not set it as the "current" version.
pre-release:
type: boolean
description: 'This is a pre-release'
required: true
default: false
env:
# Common versions
EARTHLY_VERSION: '0.8.13'
# Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run
# a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether
# credentials have been provided before trying to run steps that need them.
DOCKER_USR: ${{ secrets.DOCKER_USR }}
AWS_USR: ${{ secrets.AWS_USR }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
jobs:
promote-artifacts:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Earthly
uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.EARTHLY_VERSION }}
- name: Promote Image to docker.io/crossplane/crossplane:${{ inputs.channel }}
if: env.DOCKER_USR != ''
run: |
earthly --strict \
--push \
--secret DOCKER_USER=${{ secrets.DOCKER_USR }} \
--secret DOCKER_PASSWORD=${{ secrets.DOCKER_PSW }} \
+ci-promote-image --CHANNEL=${{ inputs.channel }} --CROSSPLANE_VERSION=${{ inputs.version }} --CROSSPLANE_REPO=docker.io/crossplane/crossplane
- name: Promote Image to xpkg.upbound.io/crossplane/crossplane:${{ inputs.channel }}
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
run: |
earthly --strict \
--push \
--secret DOCKER_USER=${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} \
--secret DOCKER_PASSWORD=${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} \
+ci-promote-image --CHANNEL=${{ inputs.channel }} --CROSSPLANE_VERSION=${{ inputs.version }} --CROSSPLANE_REPO=xpkg.upbound.io/crossplane/crossplane
- name: Promote Build Artifacts to https://releases.crossplane.io/${{ inputs.channel }}
if: env.AWS_USR != ''
run: |
earthly --strict \
--push \
--secret=AWS_ACCESS_KEY_ID=${{ secrets.AWS_USR }} \
--secret=AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_PSW }} \
+ci-promote-build-artifacts --AWS_DEFAULT_REGION=us-east-1 --CHANNEL=${{ inputs.channel }} --BUILD_DIR=${GITHUB_REF##*/} --PRERELEASE=${{ inputs.pre-release }} --CROSSPLANE_VERSION=${{ inputs.version }}