Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
Include commit hash for latest commit on main
  • Loading branch information
philnewm committed Oct 10, 2024
1 parent 79bc100 commit 1cf0dff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ jobs:
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version }}"
outputs:
artifact_file: ${{ steps.create-artifact.outputs.file_name }}
latest_commit: ${{ steps.get-commit-hash.outputs.latest_commit}}

steps:
- name: ⬇️ Checkout ${{ vars.MAIN_BRANCH }}
Expand Down Expand Up @@ -267,7 +268,7 @@ jobs:
- name: Add changed files from ${{ vars.MAIN_BRANCH }}
run: |
git add . -- ':!${{ env.OUTPUT_DIR }}/${{ steps.create-artifact.outputs.file_name }}'
git commit -m "[Automated] Add generated package files from ${{ vars.MAIN_BRANCH }}"
git commit -m "[Automated] Add generated package files to ${{ vars.MAIN_BRANCH }}"
- name: 🔏 Push to protected ${{ vars.MAIN_BRANCH }} branch
uses: CasperWA/[email protected]
Expand All @@ -277,6 +278,12 @@ jobs:
tags: false
unprotect_reviews: false

- name: Get latest commit hash on ${{ vars.MAIN_BRANCH }}
id: get-commit-hash
run: |
latest_commit_hash=$(git rev-parse HEAD)
echo "latest_commit=$latest_commit" >> GITHUB_OUPUT
- name: 🔼 Upload package zip artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -349,6 +356,7 @@ jobs:
- increment-version
env:
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version }}"
RELEASE_COMMIT: "${{ needs.build-from-main.outputs.latest_commit }}"

steps:
- name: 🔽 Download zip artifacts
Expand All @@ -359,6 +367,7 @@ jobs:
- name: 🚀 Create Github Release Draft
uses: ncipollo/release-action@v1
with:
commit: "${{ env.RELEASE_COMMIT }}"
tag: "${{ env.NEXT_VERSION }}"
generateReleaseNotes: true
artifacts: |
Expand Down
4 changes: 2 additions & 2 deletions caller_workflows/addon_repo_release_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ on:

jobs:
call-release-trigger:
uses: ynput/ops-repo-automation/.github/workflows/release_trigger.yml@0.1.0
uses: ynput/ops-repo-automation/.github/workflows/release_trigger.yml@develop
with:
draft: ${{ inputs.draft }}
# release_overwrite: ${{ inputs.release_overwrite }}
release_overwrite: ${{ inputs.release_overwrite }}
secrets:
token: ${{ secrets.YNPUT_BOT_TOKEN }}
email: ${{ secrets.CI_EMAIL }}
Expand Down

0 comments on commit 1cf0dff

Please sign in to comment.