Skip to content

Commit fcd86c2

Browse files
committed
Add release workflow
1 parent 52ce48d commit fcd86c2

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install dependencies
2424
run: npm ci
2525
- name: Install Composer dependencies
26-
run: composer install
26+
run: composer install --prefer-stable --prefer-dist --no-interaction
2727
- name: Build assets
2828
run: npm run build
2929
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: manual release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (X.X.X or vX.X.X)'
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
name: Release ${{ inputs.version }}
18+
19+
outputs:
20+
version: ${{ steps.version.outputs.version }}
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: 8.4
30+
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: lts/*
34+
35+
- name: Remove optional "v" prefix
36+
id: version
37+
run: |
38+
echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
39+
env:
40+
VERSION: ${{ inputs.version }}
41+
42+
- name: Install NPM dependencies
43+
run: npm ci
44+
45+
- name: Install Composer dependencies
46+
run: composer install --prefer-stable --prefer-dist --no-interaction
47+
48+
- name: Build assets
49+
run: npm run build
50+
51+
- name: Commit assets
52+
uses: stefanzweifel/git-auto-commit-action@v5
53+
with:
54+
commit_message: "Assets"
55+
file_pattern: dist
56+
57+
- name: Update SharpInternalServiceProvider.php version
58+
run: sed -i '' "s/const VERSION = '.*';/const VERSION = '${{ steps.version.outputs.version }}';/g" src/SharpInternalServiceProvider.php
59+
60+
- name: Commit version change
61+
uses: stefanzweifel/git-auto-commit-action@v5
62+
with:
63+
commit_message: "Update version to v${{ steps.version.outputs.version }}"
64+
file_pattern: src/SharpInternalServiceProvider.php
65+
tagging_message: "v${{ steps.version.outputs.version }}"
66+
67+
# it will deploy docs here because a tag is created

0 commit comments

Comments
 (0)