Skip to content

Commit b74ae37

Browse files
authored
Release workflow improvements [main] (#2878)
* Release workflow improvements - Remove secrets environment usage - Upload artifacts to github release - Create release notes for github release - Update CLAW with new version * Rename template file
1 parent 0c5d735 commit b74ae37

File tree

2 files changed

+114
-45
lines changed

2 files changed

+114
-45
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Package Manager Installation
2+
----------
3+
- [apt-get, yum, homebrew](https://github.com/cloudfoundry/cli#getting-started)
4+
5+
Installers
6+
----------
7+
- Debian [64 bit](https://packages.cloudfoundry.org/stable?release=debian64&version=new-version&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=debian32&version=new-version&source=github-rel) / [arm64](https://packages.cloudfoundry.org/stable?release=debianarm64&version=new-version&source=github-rel) (deb)
8+
- Redhat [64 bit](https://packages.cloudfoundry.org/stable?release=redhat64&version=new-version&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=redhat32&version=new-version&source=github-rel) / [aarch64](https://packages.cloudfoundry.org/stable?release=redhataarch64&version=new-version&source=github-rel) (rpm)
9+
- macOS [64 bit](https://packages.cloudfoundry.org/stable?release=macosx64&version=new-version&source=github-rel) / [arm](https://packages.cloudfoundry.org/stable?release=macosarm&version=new-version&source=github-rel) (pkg)
10+
- Windows [64 bit](https://packages.cloudfoundry.org/stable?release=windows64&version=new-version&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=windows32&version=new-version&source=github-rel) (zip)
11+
12+
Binaries
13+
--------
14+
- Linux [64 bit](https://packages.cloudfoundry.org/stable?release=linux64-binary&version=new-version&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=linux32-binary&version=new-version&source=github-rel) / [arm64](https://packages.cloudfoundry.org/stable?release=linuxarm64-binary&version=new-version&source=github-rel) (tgz)
15+
- macOS [64 bit](https://packages.cloudfoundry.org/stable?release=macosx64-binary&version=new-version&source=github-rel) / [arm](https://packages.cloudfoundry.org/stable?release=macosarm-binary&version=new-version&source=github-rel) (tgz)
16+
- Windows [64 bit](https://packages.cloudfoundry.org/stable?release=windows64-exe&version=new-version&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=windows32-exe&version=new-version&source=github-rel) (zip)
17+
18+
19+
Docker
20+
--------
21+
```shell
22+
docker pull cloudfoundry/cli:new-version
23+
```

.github/workflows/release-build-sign-upload.yml

Lines changed: 91 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ jobs:
8080
name: Setup
8181
# needs: test
8282
runs-on: ubuntu-latest
83-
if: ${{ github.action_repository != 'cloudfoundry/cli' }}
8483

8584
outputs:
86-
secrets-environment: ${{ steps.set-secrets-environment.outputs.secrets-environment }}
8785
aws-s3-bucket: "v${{ steps.parse-semver.outputs.version-major }}-cf-cli-releases"
8886

8987
version-build: ${{ steps.parse-semver.outputs.version-build }}
@@ -92,9 +90,6 @@ jobs:
9290
version-patch: ${{ steps.parse-semver.outputs.version-patch }}
9391

9492
steps:
95-
- id: set-secrets-environment
96-
run: echo "secrets-environment=PROD" >> "${GITHUB_OUTPUT}"
97-
9893
- name: Checkout cli
9994
uses: actions/checkout@v4
10095

@@ -124,7 +119,6 @@ jobs:
124119
needs:
125120
- setup
126121
runs-on: ubuntu-20.04
127-
environment: ${{ needs.setup.outputs.secrets-environment }}
128122

129123
env:
130124
VERSION_BUILD: ${{ needs.setup.outputs.version-build }}
@@ -398,7 +392,6 @@ jobs:
398392
VERSION_BUILD: ${{ needs.setup.outputs.version-build }}
399393
VERSION_MAJOR: ${{ needs.setup.outputs.version-major }}
400394
runs-on: macos-latest
401-
environment: ${{ needs.setup.outputs.secrets-environment }}
402395
steps:
403396

404397
- name: Get Build Version
@@ -625,7 +618,6 @@ jobs:
625618
needs:
626619
- setup
627620
runs-on: windows-2019
628-
environment: ${{ needs.setup.outputs.secrets-environment }}
629621
defaults:
630622
run:
631623
shell: pwsh
@@ -785,7 +777,6 @@ jobs:
785777
- test-deb-package
786778
- test-macos
787779
- test-windows
788-
environment: ${{ needs.setup.outputs.secrets-environment }}
789780
permissions:
790781
actions: read
791782
contents: read
@@ -887,6 +878,13 @@ jobs:
887878
signed/win32/*zip \
888879
signed/winx64/*zip
889880
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+
890888
- name: Setup aws to upload installers to CLAW S3 bucket
891889
uses: aws-actions/configure-aws-credentials@v4
892890
env:
@@ -907,41 +905,6 @@ jobs:
907905
- name: list S3 for human verification
908906
run: aws s3 ls "s3://v${VERSION_MAJOR}-cf-cli-releases/releases/v${VERSION_BUILD}/"
909907

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-
945908
test-rpm-package:
946909
name: Test RPM Artifacts
947910
needs:
@@ -969,7 +932,6 @@ jobs:
969932
needs:
970933
- setup
971934
- build-linux
972-
environment: ${{ needs.setup.outputs.secrets-environment }}
973935
runs-on: ubuntu-20.04
974936
container:
975937
image: ubuntu:20.04
@@ -1044,4 +1006,88 @@ jobs:
10441006
Get-AuthenticodeSignature -Verbose -ErrorAction Stop ".\winx64\cf${env:VERSION_MAJOR}_installer.exe"
10451007
Get-AuthenticodeSignature -Verbose -ErrorAction Stop ".\win32\cf${env:VERSION_MAJOR}_installer.exe"
10461008
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
10471093
# vim: set sw=2 ts=2 sts=2 et tw=78 foldlevel=2 fdm=indent nospell:

0 commit comments

Comments
 (0)