-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version check to CLAW update [v8] (#2907)
* Add version check to CLAW update
- Loading branch information
Showing
1 changed file
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -871,34 +871,6 @@ jobs: | |
echo | ||
echo "- ${VERSION_BUILD}" | ||
github-release-draft: | ||
name: Create GitHub Release Draft | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: write | ||
needs: | ||
- setup | ||
- test-rpm-package | ||
- test-deb-package | ||
- test-macos | ||
- test-windows | ||
steps: | ||
- name: Download signed artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: signed # download all artifacts to 'signed/' | ||
|
||
- name: Create draft release | ||
uses: pivotalsoftware/action-gh-release@v1 | ||
with: | ||
draft: true | ||
name: "DRAFT v${{ env.VERSION_BUILD }}" | ||
# tag_name: "v${{ env.VERSION_BUILD }}" | ||
repository: ${{ vars.GIT_RELEASE_TARGET_REPO }} # repo to draft a release under, in <user>/<repo> format | ||
token: ${{ secrets.GIT_REPO_ACCESS_TOKEN }} # only needed when pushing to a repo other than 'self' | ||
fail_on_unmatched_files: true | ||
|
||
test-rpm-package: | ||
name: Test RPM Artifacts | ||
needs: | ||
|
@@ -1000,4 +972,93 @@ jobs: | |
Get-AuthenticodeSignature -Verbose -ErrorAction Stop ".\winx64\cf${env:VERSION_MAJOR}_installer.exe" | ||
Get-AuthenticodeSignature -Verbose -ErrorAction Stop ".\win32\cf${env:VERSION_MAJOR}_installer.exe" | ||
github-release-draft: | ||
name: Create GitHub Release Draft | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: write | ||
needs: | ||
- setup | ||
- test-rpm-package | ||
- test-deb-package | ||
- test-macos | ||
- test-windows | ||
steps: | ||
- name: Download signed artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: final-artifacts | ||
path: artifacts # download all artifacts to 'artifacts/' | ||
|
||
- name: Checkout CLI | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare release notes | ||
run: | | ||
sed -i 's/new-version/${{ needs.setup.outputs.version-build }}/g' .github/release/release-notes-template.txt | ||
- name: Create draft release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
name: "DRAFT v${{ needs.setup.outputs.version-build }}" | ||
tag_name: "v${{ needs.setup.outputs.version-build }}" | ||
body_path: ".github/release/release-notes-template.txt" | ||
fail_on_unmatched_files: true | ||
generate_release_notes: true | ||
files: | | ||
artifacts/cf-cli-linux-rpm-packages/cf*rpm | ||
artifacts/cf-cli-linux-deb-packages/cf*deb | ||
artifacts/cf-cli-macos-packages/cf*pkg | ||
artifacts/cf-cli-windows-packages/cf*zip | ||
artifacts/linux_i686/*tgz | ||
artifacts/linux_x86-64/*tgz | ||
artifacts/linux_arm64/*tgz | ||
artifacts/osx/*tgz | ||
artifacts/macosarm/*tgz | ||
artifacts/win32/*zip | ||
artifacts/winx64/*zip | ||
update-claw: | ||
name: Add new release version to CLAW | ||
runs-on: ubuntu-latest | ||
needs: | ||
- setup | ||
- s3-upload | ||
env: | ||
VERSION_BUILD: ${{ needs.setup.outputs.version-build }} | ||
steps: | ||
- name: Checkout CLAW | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: cloudfoundry/CLAW | ||
ref: master | ||
path: CLAW | ||
ssh-key: ${{ secrets.GIT_SSH_KEY_CLAW }} | ||
|
||
- name: Add new version to claw variables | ||
run: | | ||
set -ex | ||
pushd CLAW | ||
if grep --quiet "${VERSION_BUILD}" "claw-variables.yml" ; then | ||
echo 'Version already exists in CLAW.' | ||
exit 1 | ||
else | ||
echo "- ${VERSION_BUILD}" >> claw-variables.yml | ||
git add claw-variables.yml | ||
if ! [ -z "$(git status --porcelain)"]; then | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git commit -m "Add CF CLI ${VERSION_BUILD}" | ||
else | ||
echo "no new version to commit" | ||
fi | ||
git push | ||
fi | ||
popd | ||
# vim: set sw=2 ts=2 sts=2 et tw=78 foldlevel=2 fdm=indent nospell: |