Skip to content

Commit

Permalink
Testing cutting a release
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Dec 2, 2024
1 parent 49e2836 commit 49cfc35
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
- name: Check Branch
run: |
echo "Trying to run the release workflow from branch ${{ github.ref_name }}"
if [ "${{ github.ref_name }}" != "main" ]; then
## DGM if [ "${{ github.ref_name }}" != "main" ]; then
if [ "${{ github.ref_name }}" != "fix_cut_release" ]; then
echo "Running the release workflow from the ${{ github.ref_name }} branch is not allowed"
echo "Allowed branches: main"
## DGM echo "Allowed branches: main"
echo "Allowed branches: fix_cut_release"
exit 1
else
echo "Allowed to release from branch ${{ github.ref_name }}"
Expand All @@ -62,21 +64,22 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: main
## DGM ref: main
ref: fix_cut_release
repository: ${{ github.repository }}
ssh-key: ${{ secrets.SALT_VMTOOLS_RELEASE_KEY }}

- name: Install Requirements
run: |
python3 -m pip install -r requirements/release.txt
pre-commit install --install-hooks
## - name: Install Requirements
## run: |
## python3 -m pip install -r requirements/release.txt
## pre-commit install --install-hooks

- name: Configure Git
shell: bash
run: |
git config --global --add safe.directory "$(pwd)"
git config --global user.name "Salt Project Packaging"
git config --global user.email saltproject-packaging@vmware.com
git config --global user.email saltproject.pdl@broadcom.com
git config --global commit.gpgsign false
- name: Update Repository
Expand All @@ -93,15 +96,18 @@ jobs:
- name: Commit Changes
run: |
git commit -am "Update main branch for the ${{ steps.update-repo.outputs.release-version }} release" || \
git commit -am "Update main branch for the ${{ steps.update-repo.outputs.release-version }} release"
## DGM git commit -am "Update main branch for the ${{ steps.update-repo.outputs.release-version }} release" || \
## DGM git commit -am "Update main branch for the ${{ steps.update-repo.outputs.release-version }} release"
git commit -am "Update fix_cut_release branch for the ${{ steps.update-repo.outputs.release-version }} release" || \
git commit -am "Update fix_cut_release branch for the ${{ steps.update-repo.outputs.release-version }} release"
- name: Push Changes
uses: ad-m/github-push-action@b87afee92c6e70ea888be6203a3e9426fda49839
with:
ssh: true
atomic: true
branch: main
## DGM branch: main
branch: fix_cut_release
repository: ${{ github.repository }}

- name: Upload Release Details
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/scripts/cut-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def main():
)
svtminion_script_path.write_text(
re.sub(
r'__ScriptVersion="(.*)"',
f'__ScriptVersion="{options.release_tag.lstrip("v")}"',
r'SCRIPT_VERSION="(.*)"',
f'SCRIPT_VERSION="{options.release_tag.lstrip("v")}"',
svtminion_script_path.read_text(),
)
)
Expand All @@ -212,8 +212,8 @@ def main():
)
svtminion_script_path.write_text(
re.sub(
r'\$__ScriptVersion = "(.*)"',
f'$__ScriptVersion = "{options.release_tag.lstrip("v")}"',
r'\$SCRIPT_VERSION= "(.*)"',
f'$SCRIPT_VERSION= "{options.release_tag.lstrip("v")}"',
svtminion_script_path.read_text(),
)
)
Expand Down
6 changes: 3 additions & 3 deletions windows/svtminion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ if ($help) {
}

# This value is populated via CICD during build
$script_version = "SCRIPT_VERSION_REPLACE"
$SCRIPT_VERSION = "SCRIPT_VERSION_REPLACE"
if ($Version) {
Write-Host $script_version
Write-Host $SCRIPT_VERSION
exit 0
}

Expand Down Expand Up @@ -457,7 +457,7 @@ $guestvars_salt_desired_state = "$guestvars_salt.desiredstate"


function Get-Version {
return $script_version
return $SCRIPT_VERSION
}


Expand Down

0 comments on commit 49cfc35

Please sign in to comment.