80
80
name : Setup
81
81
# needs: test
82
82
runs-on : ubuntu-latest
83
- if : ${{ github.action_repository != 'cloudfoundry/cli' }}
84
83
85
84
outputs :
86
- secrets-environment : ${{ steps.set-secrets-environment.outputs.secrets-environment }}
87
85
aws-s3-bucket : " v${{ steps.parse-semver.outputs.version-major }}-cf-cli-releases"
88
86
89
87
version-build : ${{ steps.parse-semver.outputs.version-build }}
92
90
version-patch : ${{ steps.parse-semver.outputs.version-patch }}
93
91
94
92
steps :
95
- - id : set-secrets-environment
96
- run : echo "secrets-environment=PROD" >> "${GITHUB_OUTPUT}"
97
-
98
93
- name : Checkout cli
99
94
uses : actions/checkout@v4
100
95
@@ -124,7 +119,6 @@ jobs:
124
119
needs :
125
120
- setup
126
121
runs-on : ubuntu-20.04
127
- environment : ${{ needs.setup.outputs.secrets-environment }}
128
122
129
123
env :
130
124
VERSION_BUILD : ${{ needs.setup.outputs.version-build }}
@@ -398,7 +392,6 @@ jobs:
398
392
VERSION_BUILD : ${{ needs.setup.outputs.version-build }}
399
393
VERSION_MAJOR : ${{ needs.setup.outputs.version-major }}
400
394
runs-on : macos-latest
401
- environment : ${{ needs.setup.outputs.secrets-environment }}
402
395
steps :
403
396
404
397
- name : Get Build Version
@@ -625,7 +618,6 @@ jobs:
625
618
needs :
626
619
- setup
627
620
runs-on : windows-2019
628
- environment : ${{ needs.setup.outputs.secrets-environment }}
629
621
defaults :
630
622
run :
631
623
shell : pwsh
@@ -785,7 +777,6 @@ jobs:
785
777
- test-deb-package
786
778
- test-macos
787
779
- test-windows
788
- environment : ${{ needs.setup.outputs.secrets-environment }}
789
780
permissions :
790
781
actions : read
791
782
contents : read
@@ -887,6 +878,13 @@ jobs:
887
878
signed/win32/*zip \
888
879
signed/winx64/*zip
889
880
881
+ - name : Store Artifacts
882
+ uses : actions/upload-artifact@v4
883
+ with :
884
+ if-no-files-found : error
885
+ name : final-artifacts
886
+ path : signed/*
887
+
890
888
- name : Setup aws to upload installers to CLAW S3 bucket
891
889
uses : aws-actions/configure-aws-credentials@v4
892
890
env :
@@ -907,41 +905,6 @@ jobs:
907
905
- name : list S3 for human verification
908
906
run : aws s3 ls "s3://v${VERSION_MAJOR}-cf-cli-releases/releases/v${VERSION_BUILD}/"
909
907
910
- - name : Instruct human to update CLAW
911
- run : |
912
- echo "Please go to https://github.com/cloudfoundry/CLAW/blob/develop/claw-variables.yml and add the following line to the file:"
913
- echo
914
- echo "- ${VERSION_BUILD}"
915
-
916
- github-release-draft :
917
- name : Create GitHub Release Draft
918
- runs-on : ubuntu-latest
919
- permissions :
920
- actions : read
921
- contents : write
922
- needs :
923
- - setup
924
- - test-rpm-package
925
- - test-deb-package
926
- - test-macos
927
- - test-windows
928
- environment : ${{ needs.setup.outputs.secrets-environment }}
929
- steps :
930
- - name : Download signed artifacts
931
- uses : actions/download-artifact@v4
932
- with :
933
- path : signed # download all artifacts to 'signed/'
934
-
935
- - name : Create draft release
936
- uses : pivotalsoftware/action-gh-release@v1
937
- with :
938
- draft : true
939
- name : " DRAFT v${{ env.VERSION_BUILD }}"
940
- # tag_name: "v${{ env.VERSION_BUILD }}"
941
- repository : ${{ secrets.GIT_RELEASE_TARGET_REPO }} # repo to draft a release under, in <user>/<repo> format
942
- token : ${{ secrets.GIT_REPO_ACCESS_TOKEN }} # only needed when pushing to a repo other than 'self'
943
- fail_on_unmatched_files : true
944
-
945
908
test-rpm-package :
946
909
name : Test RPM Artifacts
947
910
needs :
@@ -969,7 +932,6 @@ jobs:
969
932
needs :
970
933
- setup
971
934
- build-linux
972
- environment : ${{ needs.setup.outputs.secrets-environment }}
973
935
runs-on : ubuntu-20.04
974
936
container :
975
937
image : ubuntu:20.04
@@ -1044,4 +1006,88 @@ jobs:
1044
1006
Get-AuthenticodeSignature -Verbose -ErrorAction Stop ".\winx64\cf${env:VERSION_MAJOR}_installer.exe"
1045
1007
Get-AuthenticodeSignature -Verbose -ErrorAction Stop ".\win32\cf${env:VERSION_MAJOR}_installer.exe"
1046
1008
1009
+ github-release-draft :
1010
+ name : Create GitHub Release Draft
1011
+ runs-on : ubuntu-latest
1012
+ permissions :
1013
+ actions : read
1014
+ contents : write
1015
+ needs :
1016
+ - setup
1017
+ - test-rpm-package
1018
+ - test-deb-package
1019
+ - test-macos
1020
+ - test-windows
1021
+ steps :
1022
+ - name : Download signed artifacts
1023
+ uses : actions/download-artifact@v4
1024
+ with :
1025
+ name : final-artifacts
1026
+ path : artifacts # download all artifacts to 'artifacts/'
1027
+
1028
+ - name : Checkout CLI
1029
+ uses : actions/checkout@v4
1030
+
1031
+ - name : Prepare release notes
1032
+ run : |
1033
+ sed -i 's/new-version/${{ needs.setup.outputs.version-build }}/g' .github/release/release-notes-template.txt
1034
+
1035
+ - name : Create draft release
1036
+ uses : softprops/action-gh-release@v2
1037
+ with :
1038
+ draft : true
1039
+ name : " DRAFT v${{ needs.setup.outputs.version-build }}"
1040
+ tag_name : " v${{ needs.setup.outputs.version-build }}"
1041
+ body_path : " .github/release/release-notes-template.txt"
1042
+ fail_on_unmatched_files : true
1043
+ generate_release_notes : true
1044
+ files : |
1045
+ artifacts/cf-cli-linux-rpm-packages/cf*rpm
1046
+ artifacts/cf-cli-linux-deb-packages/cf*deb
1047
+ artifacts/cf-cli-macos-packages/cf*pkg
1048
+ artifacts/cf-cli-windows-packages/cf*zip
1049
+ artifacts/linux_i686/*tgz
1050
+ artifacts/linux_x86-64/*tgz
1051
+ artifacts/linux_arm64/*tgz
1052
+ artifacts/osx/*tgz
1053
+ artifacts/macosarm/*tgz
1054
+ artifacts/win32/*zip
1055
+ artifacts/winx64/*zip
1056
+
1057
+ update-claw :
1058
+ name : Add new release version to CLAW
1059
+ runs-on : ubuntu-latest
1060
+ needs :
1061
+ - setup
1062
+ - s3-upload
1063
+ env :
1064
+ VERSION_BUILD : ${{ needs.setup.outputs.version-build }}
1065
+ steps :
1066
+ - name : Checkout CLAW
1067
+ uses : actions/checkout@v4
1068
+ with :
1069
+ repository : cloudfoundry/CLAW
1070
+ ref : develop
1071
+ path : CLAW
1072
+ ssh-key : ${{ secrets.GIT_SSH_KEY_CLAW }}
1073
+
1074
+ - name : Add new version to claw variables
1075
+ run : |
1076
+ set -ex
1077
+
1078
+ pushd CLAW
1079
+ echo "- ${VERSION_BUILD}" >> claw-variables.yml
1080
+
1081
+ git add claw-variables.yml
1082
+
1083
+ if ! [ -z "$(git status --porcelain)"]; then
1084
+ git config user.name github-actions
1085
+ git config user.email [email protected]
1086
+ git commit -m "Add CF CLI ${VERSION_BUILD}"
1087
+ else
1088
+ echo "no new version to commit"
1089
+ fi
1090
+
1091
+ git push
1092
+ popd
1047
1093
# vim: set sw=2 ts=2 sts=2 et tw=78 foldlevel=2 fdm=indent nospell:
0 commit comments