8
8
9
9
env :
10
10
GRADLE_OPTS : -Dorg.gradle.daemon=false -Xmx2g -Xms2g
11
+ CONTAINER_REGISTRY : us-docker.pkg.dev/spinnaker-community/docker
11
12
12
13
jobs :
13
14
release :
30
31
echo ::set-output name=SKIP_RELEASE::${SKIP_RELEASE}
31
32
echo ::set-output name=IS_CANDIDATE::${IS_CANDIDATE}
32
33
echo ::set-output name=RELEASE_VERSION::${RELEASE_VERSION}
34
+ - name : Extract repository name
35
+ id : extract_repo_name
36
+ run : echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/}
33
37
- name : Release build
34
38
env :
35
39
ORG_GRADLE_PROJECT_version : ${{ steps.release_info.outputs.RELEASE_VERSION }}
@@ -39,16 +43,58 @@ jobs:
39
43
ORG_GRADLE_PROJECT_nexusPgpSigningKey : ${{ secrets.NEXUS_PGP_SIGNING_KEY }}
40
44
ORG_GRADLE_PROJECT_nexusPgpSigningPassword : ${{ secrets.NEXUS_PGP_SIGNING_PASSWORD }}
41
45
run : |
42
- ./gradlew --info publishToNexus closeAndReleaseNexusStagingRepository
46
+ ./gradlew --info build ${{ steps.extract_repo_name.outputs.REPO }}-web:installDist publishToNexus closeAndReleaseNexusStagingRepository
47
+ - name : Publish apt packages to Google Artifact Registry
48
+ env :
49
+ ORG_GRADLE_PROJECT_version : ${{ steps.release_info.outputs.RELEASE_VERSION }}
50
+ ORG_GRADLE_PROJECT_artifactRegistryPublishEnabled : true
51
+ GAR_JSON_KEY : ${{ secrets.GAR_JSON_KEY }}
52
+ run : |
53
+ ./gradlew --info publish
54
+ - name : Get date
55
+ id : get_date
56
+ run : echo ::set-output name=DATETIME::$(date --utc +'%Y%m%d%H%M')
57
+ - name : Login to GAR
58
+ # Only run this on repositories in the 'spinnaker' org, not on forks.
59
+ if : startsWith(github.repository, 'spinnaker/')
60
+ uses : docker/login-action@v1
61
+ # use service account flow defined at: https://github.com/docker/login-action#service-account-based-authentication-1
62
+ with :
63
+ registry : us-docker.pkg.dev
64
+ username : _json_key
65
+ password : ${{ secrets.GAR_JSON_KEY }}
66
+ - name : Build and publish slim container image
67
+ # Only run this on repositories in the 'spinnaker' org, not on forks.
68
+ if : startsWith(github.repository, 'spinnaker/')
69
+ uses : docker/build-push-action@v2
70
+ with :
71
+ context : .
72
+ file : Dockerfile.slim
73
+ push : true
74
+ tags : |
75
+ "${{ env.CONTAINER_REGISTRY }}/${{ steps.extract_repo_name.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-unvalidated"
76
+ "${{ env.CONTAINER_REGISTRY }}/${{ steps.extract_repo_name.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-unvalidated-slim"
77
+ "${{ env.CONTAINER_REGISTRY }}/${{ steps.extract_repo_name.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-${{ github.sha }}-${{ steps.get_date.outputs.DATETIME }}-unvalidated-slim"
78
+ - name : Build and publish ubuntu container image
79
+ # Only run this on repositories in the 'spinnaker' org, not on forks.
80
+ if : startsWith(github.repository, 'spinnaker/')
81
+ uses : docker/build-push-action@v2
82
+ with :
83
+ context : .
84
+ file : Dockerfile.ubuntu
85
+ push : true
86
+ tags : |
87
+ "${{ env.CONTAINER_REGISTRY }}/${{ steps.extract_repo_name.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-unvalidated-ubuntu"
88
+ "${{ env.CONTAINER_REGISTRY }}/${{ steps.extract_repo_name.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-${{ github.sha }}-${{ steps.get_date.outputs.DATETIME }}-unvalidated-ubuntu"
43
89
- name : Create release
44
90
if : steps.release_info.outputs.SKIP_RELEASE == 'false'
45
91
uses : actions/create-release@v1
46
92
env :
47
93
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
94
with :
49
- tag_name : ${{ github.ref }}
50
- release_name : ${{ github.event.repository.name }} ${{ github.ref }}
51
- body : |
95
+ tag_name : ${{ github.ref }}
96
+ release_name : ${{ github.event.repository.name }} ${{ github.ref }}
97
+ body : |
52
98
${{ steps.release_info.outputs.CHANGELOG }}
53
- draft : false
54
- prerelease : ${{ steps.release_info.outputs.IS_CANDIDATE }}
99
+ draft : false
100
+ prerelease : ${{ steps.release_info.outputs.IS_CANDIDATE }}
0 commit comments