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

Trigger release workflow #1988

Merged
merged 38 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c9a7d1e
restoring compatibility tests
Jan 29, 2025
599ca7e
fix carthage tests
Jan 29, 2025
faacbb0
renamed build.yml to test-compatibility.yml
Jan 29, 2025
840ee1b
Adding create_release workflow
Jan 29, 2025
44492ae
tiny change
Jan 29, 2025
6f5fe82
Release/test release workflow 1 (#1976)
goergisn Jan 29, 2025
0f64317
trying out some things
Jan 29, 2025
b1a3483
trying some things
Jan 29, 2025
88089fe
Release/test release workflow 1 (#1977)
goergisn Jan 29, 2025
c79895d
debugging
Jan 29, 2025
4d7a988
debugging (#1978)
goergisn Jan 29, 2025
fea4781
test
Jan 29, 2025
8e23296
test (#1979)
goergisn Jan 29, 2025
af88c49
maybe this works
Jan 29, 2025
19f8b11
maybe this works (#1980)
goergisn Jan 29, 2025
8a24f8f
let’s try this
Jan 29, 2025
715b11b
let’s try this (#1981)
goergisn Jan 29, 2025
81ea284
trying to get version number
Jan 29, 2025
d178743
trying to get version number (#1982)
goergisn Jan 29, 2025
9d15552
does this work?
Jan 29, 2025
d056262
does this work? (#1983)
goergisn Jan 29, 2025
7283768
small change
Jan 29, 2025
7f9d43c
small change (#1984)
goergisn Jan 29, 2025
084a8c9
fixing the commitish
Jan 29, 2025
7640006
fixing the commitish (#1985)
goergisn Jan 29, 2025
3a5363e
using release_body
Jan 29, 2025
20992c4
using release_body (#1986)
goergisn Jan 29, 2025
2495603
Removing unneeded code
Jan 29, 2025
fcea1fd
Removing unneeded code (#1987)
goergisn Jan 29, 2025
b9d2f0a
Merge branch 'restore-build-yml' into trigger-release-workflow
Jan 30, 2025
d0d018f
simplifying script
Jan 30, 2025
9ff8c66
rename to create change
Jan 30, 2025
688ec4d
rename to create change (#1989)
goergisn Jan 30, 2025
94340c6
some script refactoring
Jan 30, 2025
f81d72e
some script refactoring (#1990)
goergisn Jan 30, 2025
972fbe3
not running the label validation on release branches
Jan 30, 2025
3269699
not running the label validation on release branches (#1991)
goergisn Jan 30, 2025
cc15dfc
Merge branch 'develop' into trigger-release-workflow
Jan 30, 2025
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
58 changes: 58 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "🚀 Release on merge"

on:
pull_request:
types: [closed]

jobs:
create_release:
if: github.event.pull_request.merged == true
name: "Create Release"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch Pull Request Details
run: |
SOURCE_BRANCH=${{ github.event.pull_request.head.ref }}

# Checking if the source branch was a release
if [[ "$SOURCE_BRANCH" != release/* ]]; then
echo "Source branch does not match pattern. Exiting."
exit 1
fi

# Extracting the version number from the source branch name
VERSION_NUMBER=${SOURCE_BRANCH#release/}
if [[ ! "$VERSION_NUMBER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "'$VERSION_NUMBER' does not match semantic versioning format. Exiting."
exit 1
fi

MERGE_COMMIT_SHA=${{ github.event.pull_request.merge_commit_sha }}
PR_NUMBER=${{ github.event.pull_request.number }}

echo "SOURCE_BRANCH=$SOURCE_BRANCH" >> $GITHUB_ENV
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV
echo "MERGE_COMMIT_SHA=$MERGE_COMMIT_SHA" >> $GITHUB_ENV

# Requesting the PR info
PR_INFO=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER})

# Extracting the PR body from the PR info
PR_BODY=$(jq --raw-output .body <<< "$PR_INFO")
echo "PR Body: $PR_BODY"

echo "$PR_BODY" >> "${{ github.workspace }}/release_content.md"

- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: "${{ github.workspace }}/release_content.md"
draft: true
target_commitish: ${{ env.MERGE_COMMIT_SHA }}
tag_name: ${{ env.VERSION_NUMBER }}
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/validate_pr_labels_and_release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
get-pr-labels:
if: "!startsWith(github.event.pull_request.head.ref, 'release/')"
runs-on: ubuntu-latest
steps:
- name: Fetch repo
Expand Down
Loading