-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from ruedigerp/develop
Develop
- Loading branch information
Showing
2 changed files
with
54 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ name: Build, Package, Release [dev] | |
on: | ||
push: | ||
branches: | ||
- developX | ||
- develop | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -30,58 +31,52 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.MO_CLI_TOKEN }} | ||
|
||
# - name: Install Node.js | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: "18" | ||
|
||
# - name: Install dependencies | ||
# run: npm install | ||
|
||
# - name: Apply Changesets | ||
# id: changesets | ||
# run: | | ||
# # Bump the version and commit the changes | ||
# npx changeset version | ||
# # Push the changes back to the repo | ||
# git config user.name "github-actions[bot]" | ||
# git config user.email "github-actions[bot]@users.noreply.github.com" | ||
# git push --follow-tags origin ${{ github.ref_name }} | ||
|
||
# - name: Extract new version | ||
# id: get_version | ||
# run: echo "tag=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV | ||
# - name: Create Sematic Release Version | ||
# run: | | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "ruedigerp" | ||
# git config --global credential.helper cache | ||
# npx standard-version --prerelease dev | ||
# git push --follow-tags origin delevop | ||
|
||
# - name: release-please | ||
# uses: googleapis/release-please-action@v4 | ||
# id: release | ||
# with: | ||
# token: ${{ secrets.MO_CLI_TOKEN }} | ||
# release-type: simple | ||
# target-branch: ${{ github.ref_name }} | ||
|
||
# - name: Fetch latest tags | ||
# run: git fetch --tags | ||
|
||
# - name: Get latest version tag | ||
# id: get_tag | ||
# # run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
# run: echo "tag=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV | ||
|
||
# - name: Debug Outputs | ||
# run: | | ||
# echo "Outputs: ${{ toJson(steps.release.outputs) }}" | ||
|
||
# - name: Get the current version | ||
# id: get_version | ||
# run: echo "VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV | ||
- name: Get latest tag | ||
id: get_tag | ||
run: | ||
echo "current tag=$(git describe --tags --abbrev=0)" | ||
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
|
||
- name: Bump version | ||
id: bump_version | ||
run: | | ||
# Neueste Commit-Nachricht abrufen | ||
commit_message=$(git log -1 --pretty=%B) | ||
# Alte Version ohne das 'v' | ||
version=${tag/v/} | ||
# Version in Major, Minor, Patch aufteilen | ||
IFS='.' read -r major minor patch <<< "$version" | ||
# Basierend auf Commit-Nachricht die Version erhöhen | ||
if [[ "$commit_message" == fix:* ]]; then | ||
patch=$((patch + 1)) # Patch erhöhen | ||
elif [[ "$commit_message" == feat:* ]]; then | ||
minor=$((minor + 1)) # Minor erhöhen | ||
patch=0 # Patch zurücksetzen | ||
elif [[ "$commit_message" == chore:* ]]; then | ||
major=$((major + 1)) # Major erhöhen | ||
minor=0 # Minor zurücksetzen | ||
patch=0 # Patch zurücksetzen | ||
else | ||
echo "No version bump for commit message: $commit_message" | ||
exit 0 | ||
fi | ||
# Neue Version erstellen | ||
new_version="v${major}.${minor}.${patch}" | ||
# Prüfen, ob der aktuelle Branch 'develop' ist | ||
# branch_name=$(echo "${GITHUB_REF##*/}") | ||
# if [[ "$branch_name" == "develop" ]]; then | ||
# new_version="${new_version}-develop" | ||
# fi | ||
echo "new_version=$new_version" >> $GITHUB_ENV | ||
echo "::set-output name=new_version::$new_version" | ||
|
||
- name: Create new tag | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git tag ${{ env.new_version }} | ||
git push origin ${{ env.new_version }} | ||
- name: Create release in another repo | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters