Skip to content

Commit

Permalink
Merge pull request #31 from ruedigerp/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ruedigerp authored Dec 11, 2024
2 parents 0ba1f95 + bf10c2a commit 54d25cc
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 53 deletions.
101 changes: 48 additions & 53 deletions .github/workflows/develop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ jobs:
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"

Expand Down

0 comments on commit 54d25cc

Please sign in to comment.