-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add automatic tags for all shopware releases
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Update Tags | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
update: | ||
name: Update Tags | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Create missing tags | ||
run: bash update.sh | ||
- name: Push tags | ||
run: | | ||
git push --tags |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
tags=$(curl -s --fail https://api.github.com/repos/shopware/core/tags) | ||
|
||
for tag in $(echo "${tags}" | jq -r '.[].name'); do | ||
# check for the existence of tag in git | ||
if ! git rev-parse "${tag}" >/dev/null 2>&1; then | ||
# update .packages.shopware/core to $tag | ||
echo "Updating shopware/core to ${tag}" | ||
jq --arg tag "${tag}" '.require."shopware/core" = $tag' composer.json > composer.json.tmp | ||
mv composer.json.tmp composer.json | ||
git add composer.json | ||
git commit -m "Update shopware/core to ${tag}" | ||
git tag -m "Release: ${tag}" "${tag}" | ||
git reset --hard origin/trunk | ||
echo "Created tag ${tag}" | ||
fi | ||
done |