Skip to content

Commit 0c4c7ed

Browse files
committed
Updates
1 parent 8f7d32e commit 0c4c7ed

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Read version from composer.json
20+
id: version
21+
run: |
22+
VERSION=$(jq -r '.version' composer.json)
23+
24+
if [ "$VERSION" = "null" ] || [ -z "$VERSION" ]; then
25+
echo "❌ Version not found in composer.json"
26+
exit 1
27+
fi
28+
29+
echo "version=v$VERSION" >> $GITHUB_OUTPUT
30+
31+
- name: Delete existing release and tag if they exist
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
TAG="${{ steps.version.outputs.version }}"
36+
37+
if gh release view "$TAG" > /dev/null 2>&1; then
38+
echo "⚠️ Release $TAG already exists. Deleting..."
39+
gh release delete "$TAG" --yes
40+
git push --delete origin "$TAG" || true
41+
else
42+
echo "✅ No existing release for $TAG"
43+
fi
44+
45+
- name: Create GitHub Release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
tag_name: ${{ steps.version.outputs.version }}
49+
name: Release ${{ steps.version.outputs.version }}
50+
generate_release_notes: true
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "ziorwebdev/plugin-common",
33
"description": "A common package for ZIORWeb.Dev plugins",
4+
"version": "1.0.5",
45
"type": "library",
56
"autoload": {
67
"psr-4": {

0 commit comments

Comments
 (0)