Less release prep steps on tag pushes

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-03-27 14:29:48 +01:00 committed by Thomas Phipps
parent e2374a9f1d
commit 4c52012c9a
10 changed files with 77 additions and 26 deletions

View file

@ -25,16 +25,19 @@ runs:
steps:
- name: Download Release Patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}.patch
- name: Configure Git
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
shell: bash
run: |
tools pkg configure-git
- name: Apply Release Patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
shell: bash
run: |
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete

View file

@ -44,6 +44,7 @@ jobs:
path: pkgs/checkout/artifacts/
- name: Download Release Patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}.patch
@ -62,11 +63,13 @@ jobs:
cwd: pkgs/checkout/
- name: Configure Git
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
working-directory: pkgs/checkout/
run: |
tools pkg configure-git
- name: Apply release patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
working-directory: pkgs/checkout/
run: |
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete

View file

@ -35,6 +35,7 @@ jobs:
- uses: actions/checkout@v3
- name: Download Release Patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}.patch
@ -50,10 +51,12 @@ jobs:
uses: ./.github/actions/setup-python-tools-scripts
- name: Configure Git
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools pkg configure-git
- name: Apply release patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete

View file

@ -39,6 +39,7 @@ jobs:
path: artifacts/
- name: Download Release Patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}.patch
@ -53,10 +54,12 @@ jobs:
salt-version: "${{ inputs.salt-version }}"
- name: Configure Git
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools pkg configure-git
- name: Apply release patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete

View file

@ -256,28 +256,30 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
# TODO: Remove the --salt-version argument post 3006 release. This was to handle versioning
# issues on pre-3006 development versions on deb-based distros.
- name: Update Debian changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}" --draft
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}"
tools changelog update-deb --draft
tools changelog update-deb
- name: Update RPM changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-rpm --draft
tools changelog update-rpm
- name: Update Release Notes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-release-notes --draft
tools changelog update-release-notes
- name: Generate MAN Pages
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
LATEST_RELEASE: "${{ needs.prepare-workflow.outputs.salt-version }}"
SALT_ON_SALTSTACK: "1"
@ -286,22 +288,26 @@ jobs:
- name: Update Changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-changelog-md --draft
tools changelog update-changelog-md
- name: Show Changes Diff
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git diff --color
- name: Configure Git
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email saltproject-packaging@vmware.com
- name: Setup Pre-Commit
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: ./.github/actions/setup-pre-commit
with:
version: "3.0.4"
@ -309,6 +315,7 @@ jobs:
- name: Commit Changes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
SKIP: lint-salt,lint-tests
run: |
@ -318,11 +325,13 @@ jobs:
- name: Create release changes patch
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git format-patch --keep-subject --binary --stdout HEAD^ > salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
- name: Upload Changes Diff Artifact
uses: actions/upload-artifact@v3
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
with:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
path: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch

View file

@ -300,28 +300,30 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
# TODO: Remove the --salt-version argument post 3006 release. This was to handle versioning
# issues on pre-3006 development versions on deb-based distros.
- name: Update Debian changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}" --draft
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}"
tools changelog update-deb --draft
tools changelog update-deb
- name: Update RPM changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-rpm --draft
tools changelog update-rpm
- name: Update Release Notes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-release-notes --draft
tools changelog update-release-notes
- name: Generate MAN Pages
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
LATEST_RELEASE: "${{ needs.prepare-workflow.outputs.salt-version }}"
SALT_ON_SALTSTACK: "1"
@ -330,22 +332,26 @@ jobs:
- name: Update Changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-changelog-md --draft
tools changelog update-changelog-md
- name: Show Changes Diff
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git diff --color
- name: Configure Git
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email saltproject-packaging@vmware.com
- name: Setup Pre-Commit
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: ./.github/actions/setup-pre-commit
with:
version: "3.0.4"
@ -353,6 +359,7 @@ jobs:
- name: Commit Changes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
SKIP: lint-salt,lint-tests
run: |
@ -362,11 +369,13 @@ jobs:
- name: Create release changes patch
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git format-patch --keep-subject --binary --stdout HEAD^ > salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
- name: Upload Changes Diff Artifact
uses: actions/upload-artifact@v3
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
with:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
path: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch

View file

@ -299,28 +299,30 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
# TODO: Remove the --salt-version argument post 3006 release. This was to handle versioning
# issues on pre-3006 development versions on deb-based distros.
- name: Update Debian changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}" --draft
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}"
tools changelog update-deb --draft
tools changelog update-deb
- name: Update RPM changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-rpm --draft
tools changelog update-rpm
- name: Update Release Notes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-release-notes --draft
tools changelog update-release-notes
- name: Generate MAN Pages
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
LATEST_RELEASE: "${{ needs.prepare-workflow.outputs.salt-version }}"
SALT_ON_SALTSTACK: "1"
@ -329,22 +331,26 @@ jobs:
- name: Update Changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-changelog-md --draft
tools changelog update-changelog-md
- name: Show Changes Diff
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git diff --color
- name: Configure Git
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email saltproject-packaging@vmware.com
- name: Setup Pre-Commit
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: ./.github/actions/setup-pre-commit
with:
version: "3.0.4"
@ -352,6 +358,7 @@ jobs:
- name: Commit Changes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
SKIP: lint-salt,lint-tests
run: |
@ -361,11 +368,13 @@ jobs:
- name: Create release changes patch
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git format-patch --keep-subject --binary --stdout HEAD^ > salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
- name: Upload Changes Diff Artifact
uses: actions/upload-artifact@v3
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
with:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
path: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch

View file

@ -303,28 +303,30 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
release: true
# TODO: Remove the --salt-version argument post 3006 release. This was to handle versioning
# issues on pre-3006 development versions on deb-based distros.
- name: Update Debian changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}" --draft
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}"
tools changelog update-deb --draft
tools changelog update-deb
- name: Update RPM changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-rpm --draft
tools changelog update-rpm
- name: Update Release Notes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-release-notes --draft --release
tools changelog update-release-notes --release
- name: Generate MAN Pages
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
LATEST_RELEASE: "${{ needs.prepare-workflow.outputs.salt-version }}"
SALT_ON_SALTSTACK: "1"
@ -333,22 +335,26 @@ jobs:
- name: Update Changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-changelog-md --draft
tools changelog update-changelog-md
- name: Show Changes Diff
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git diff --color
- name: Configure Git
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email saltproject-packaging@vmware.com
- name: Setup Pre-Commit
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: ./.github/actions/setup-pre-commit
with:
version: "3.0.4"
@ -356,6 +362,7 @@ jobs:
- name: Commit Changes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
SKIP: lint-salt,lint-tests
run: |
@ -365,11 +372,13 @@ jobs:
- name: Create release changes patch
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git format-patch --keep-subject --binary --stdout HEAD^ > salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
- name: Upload Changes Diff Artifact
uses: actions/upload-artifact@v3
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
with:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
path: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch

View file

@ -98,28 +98,30 @@ on:
release: true
<%- endif %>
# TODO: Remove the --salt-version argument post 3006 release. This was to handle versioning
# issues on pre-3006 development versions on deb-based distros.
- name: Update Debian changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}" --draft
tools changelog update-deb "${{ needs.prepare-workflow.outputs.salt-version }}"
tools changelog update-deb --draft
tools changelog update-deb
- name: Update RPM changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-rpm --draft
tools changelog update-rpm
- name: Update Release Notes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-release-notes --draft <%- if prepare_actual_release %> --release <%- endif %>
tools changelog update-release-notes <%- if prepare_actual_release %> --release <%- endif %>
- name: Generate MAN Pages
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
LATEST_RELEASE: "${{ needs.prepare-workflow.outputs.salt-version }}"
SALT_ON_SALTSTACK: "1"
@ -128,22 +130,26 @@ on:
- name: Update Changelog
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools changelog update-changelog-md --draft
tools changelog update-changelog-md
- name: Show Changes Diff
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git diff --color
- name: Configure Git
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git config --global user.name "Salt Project Packaging"
git config --global user.email saltproject-packaging@vmware.com
- name: Setup Pre-Commit
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: ./.github/actions/setup-pre-commit
with:
version: "<{ pre_commit_version }>"
@ -151,6 +157,7 @@ on:
- name: Commit Changes
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
env:
SKIP: lint-salt,lint-tests
run: |
@ -160,11 +167,13 @@ on:
- name: Create release changes patch
shell: bash
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
git format-patch --keep-subject --binary --stdout HEAD^ > salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
- name: Upload Changes Diff Artifact
uses: actions/upload-artifact@v3
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
with:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch
path: salt-${{ needs.prepare-workflow.outputs.salt-version }}.patch

View file

@ -363,12 +363,6 @@ def define_jobs(
wfh.write("Selected Jobs:\n")
for name, value in sorted(jobs.items()):
wfh.write(f" - {name}: {value}\n")
wfh.write(
"\n<details>\n<summary>All Changed Files (click me)</summary>\n<pre>\n"
)
for path in sorted(json.loads(changed_files_contents["repo_files"])):
wfh.write(f"{path}\n")
wfh.write("</pre>\n</details>\n")
ctx.info("Writing 'jobs' to the github outputs file")
with open(github_output, "a", encoding="utf-8") as wfh: