Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version check to CLAW update [v8] #2907

Merged
merged 8 commits into from
May 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/release-build-sign-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1000,4 +1000,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 -q "${VERSION_BUILD}" "claw-variables.yml" ; then
gururajsh marked this conversation as resolved.
Show resolved Hide resolved
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 github-actions@github.com
git commit -m "Add CF CLI ${VERSION_BUILD}"
else
echo "no new version to commit"
fi
gururajsh marked this conversation as resolved.
Show resolved Hide resolved

git push
fi
popd
# vim: set sw=2 ts=2 sts=2 et tw=78 foldlevel=2 fdm=indent nospell:
Loading