Skip to content

Commit 4eabc85

Browse files
authored
Merge branch 'main' into applicationStructure
2 parents 77d7c7f + f7c42e3 commit 4eabc85

6 files changed

Lines changed: 119 additions & 73 deletions

File tree

.github/scripts/version.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ php artisan phpvms:version
1717
if test "$GIT_TAG_NAME"; then
1818
echo "Tagged with ${GIT_TAG_NAME}"
1919
export FILE_NAME="phpvms-${GIT_TAG_NAME}"
20+
#export IMAGE_NAME="phpvms:${GIT_TAG_NAME}"
2021
else
2122
export BRANCH=${GITHUB_REF##*/}
2223
echo "On branch $BRANCH"
23-
export FILE_NAME="phpvms-${NBGV_PrereleaseVersionNoLeadingHyphen}"
24+
export FILE_NAME="phpvms-${BRANCH}"
25+
#export IMAGE_NAME="phpvms:${NBGV_SemVer2}"
2426
fi
2527

2628
export TAR_NAME="$FILE_NAME.tar.gz"
@@ -41,6 +43,7 @@ echo "TAR_NAME=${TAR_NAME}" >> "$GITHUB_ENV"
4143
echo "ZIP_NAME=${ZIP_NAME}" >> "$GITHUB_ENV"
4244
echo "BASE_DIR=${BASE_DIR}" >> "$GITHUB_ENV"
4345
echo "FULL_VERSION=${FULL_VERSION}" >> "$GITHUB_ENV"
46+
#echo "IMAGE_NAME=${IMAGE_NAME}" >> "$GITHUB_ENV"
4447

4548
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
4649
echo "full_version=${FULL_VERSION}" >> "$GITHUB_OUTPUT"

.github/workflows/build.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,25 @@ jobs:
9797
php --version
9898
mysql --version
9999
composer install --dev --no-interaction --verbose
100+
composer global require laravel/pint
100101
composer dump-autoload
101102
cp .github/scripts/env.test .env
102103
cp .github/scripts/phpunit.xml phpunit.xml
103104
.github/scripts/version.sh
104105
php artisan database:create --reset
105106
php artisan migrate:refresh --seed
106107
107-
- name: Get version
108-
run: .github/scripts/version.sh
108+
- name: Run Pint
109+
run: pint --test
109110

110111
- name: Run Tests
111112
run: |
112113
export PHP_CS_FIXER_IGNORE_ENV=1
113114
vendor/bin/pest --parallel --ci
114115
115-
- name: Run Rector
116-
run: |
117-
vendor/bin/rector --dry-run
116+
# - name: Run Rector
117+
# run: |
118+
# vendor/bin/rector --dry-run
118119

119120
# This runs after all of the tests, run have run. Creates a cleaned up version of the
120121
# distro, and then creates the artifact to push up to S3 or wherever
@@ -214,13 +215,33 @@ jobs:
214215
id-token: write
215216
runs-on: ubuntu-latest
216217
needs: [build]
217-
if: github.repository == 'phpvms/phpvms' && github.event_name != 'pull_request' && (github.ref == 'refs/heads/dev')
218+
if: github.repository == 'phpvms/phpvms' && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
218219
steps:
219220
- name: Checkout
220221
uses: actions/checkout@v4
221222
with:
222223
fetch-depth: 0
223224

225+
# Configure Caching
226+
- name: Get composer cache directory
227+
id: composer-cache
228+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
229+
230+
- name: Cache dependencies
231+
uses: actions/cache@v4
232+
with:
233+
path: ${{ steps.composer-cache.outputs.dir }}
234+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
235+
restore-keys: ${{ runner.os }}-composer-
236+
237+
# Dependencies
238+
- name: 'Install Release Dependencies'
239+
run: |
240+
rm -rf vendor
241+
composer install --no-dev --prefer-dist --no-interaction --verbose
242+
composer dump-autoload
243+
sudo chmod +x ./.github/scripts/*
244+
224245
# https://github.com/marketplace/actions/nerdbank-gitversioning
225246
- name: Nerdbank.GitVersioning
226247
uses: dotnet/nbgv@v0.4.2
@@ -244,9 +265,9 @@ jobs:
244265
with:
245266
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
246267
tags: |
247-
type=edge,branch=dev
268+
type=semver,pattern={{version}},value=${{ env.NBGV_SemVer2 }}
269+
type=semver,pattern={{version}},value=${{ env.NBGV_MajorMinorVersion }}
248270
type=ref,event=branch
249-
# type=sha,enable=false
250271
251272
- name: Build and push
252273
id: push

.github/workflows/lint.yml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,35 @@
33
# Run Laravel Pint
44
# https://laravel.com/docs/11.x/pint#running-tests-on-github-actions
55
#
6-
name: Check Code Style
7-
8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- main
13-
- dev
14-
- "feature/**"
15-
- "release/**"
16-
- "hotfix/**"
17-
18-
jobs:
19-
lint:
20-
runs-on: ubuntu-latest
21-
strategy:
22-
fail-fast: true
23-
matrix:
24-
php: [8.4]
25-
26-
steps:
27-
- name: Checkout code
28-
uses: actions/checkout@v4
29-
30-
- name: Setup PHP
31-
uses: shivammathur/setup-php@v2
32-
with:
33-
php-version: ${{ matrix.php }}
34-
extensions: json, dom, curl, libxml, mbstring
35-
coverage: none
6+
# name: Check Code Style
7+
#
8+
# on:
9+
# pull_request:
10+
# push:
11+
# branches:
12+
# - main
13+
# - dev
14+
# - "feature/**"
15+
# - "release/**"
16+
# - "hotfix/**"
17+
#
18+
# jobs:
19+
# lint:
20+
# runs-on: ubuntu-latest
21+
# strategy:
22+
# fail-fast: true
23+
# matrix:
24+
# php: [8.4]
25+
#
26+
# steps:
27+
# - name: Checkout code
28+
# uses: actions/checkout@v4
29+
#
30+
# - name: Setup PHP
31+
# uses: shivammathur/setup-php@v2
32+
# with:
33+
# php-version: ${{ matrix.php }}
34+
# extensions: json, dom, curl, libxml, mbstring
35+
# coverage: none
3636

37-
- name: Install Pint
38-
run: composer global require laravel/pint
3937

40-
- name: Run Pint
41-
run: pint --test

.github/workflows/release.yml

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
---
22
name: release
33
on:
4-
release:
5-
types: [ published ]
4+
workflow_dispatch:
65

76
env:
87
REGISTRY: ghcr.io
98
IMAGE_NAME: ${{ github.repository }}
109

1110
jobs:
11+
bump-version:
12+
name: Bump Version and Push Tag
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
outputs:
17+
version: ${{ env.NBGV_SemVer2 }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Determine Version
24+
uses: dotnet/nbgv@master
25+
id: ngbv
26+
with:
27+
setAllVars: true
1228
release:
1329
runs-on: ${{ matrix.os }}
1430
permissions:
@@ -50,17 +66,6 @@ jobs:
5066
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5167
restore-keys: ${{ runner.os }}-composer-
5268

53-
# - name: Update Release Notes
54-
# uses: ./gitreleasemanager/create
55-
# with:
56-
# token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
57-
# owner: ${{ github.repository_owner }}
58-
# repository: phpvms
59-
# milestone: "v${{ steps.gitversion.outputs.majorMinorPatch }}"
60-
# name: "v${{ steps.gitversion.outputs.majorMinorPatch }}"
61-
# isPreRelease: ${{ github.event.release.prerelease }}
62-
# targetcommitish: 'main'
63-
6469
# Dependencies
6570
- name: 'Install Release Dependencies'
6671
run: |
@@ -107,23 +112,6 @@ jobs:
107112
cdn_domain: phpvms.cdn.vmslabs.net
108113
permission: public-read
109114

110-
# - name: Add Assets
111-
# uses: ./gitreleasemanager/addasset
112-
# with:
113-
# token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
114-
# owner: ${{ github.repository_owner }}
115-
# repository: phpvms
116-
# targetDirectory: dist/
117-
# assets: ${{ env.TAR_NAME }},${{ env.TAR_NAME }}.sha256,${{ env.ZIP_NAME }},${{ env.ZIP_NAME }}.sha256
118-
119-
# - name: Close Release
120-
# uses: ./gitreleasemanager/close
121-
# with:
122-
# token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
123-
# owner: ${{ github.repository_owner }}
124-
# repository: actions
125-
# milestone: "v${{ steps.gitversion.outputs.majorMinorPatch }}"
126-
127115
# Push to Docker
128116
- name: Login to GitHub Container Registry
129117
uses: docker/login-action@v3

Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
5+
<PrivateAssets>all</PrivateAssets>
6+
<Version>3.7.115</Version>
7+
</PackageReference>
8+
</ItemGroup>
9+
</Project>

version.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "8.0-alpha.{height}",
4+
"publicReleaseRefSpec": [
5+
"^refs/heads/main$",
6+
"^refs/heads/releases/v\\d+(?:\\.\\d+)?$"
7+
],
8+
"release": {
9+
"branchName": "releases/v{version}",
10+
"versionIncrement": "build",
11+
"firstUnstableTag": "alpha"
12+
},
13+
"cloudBuild": {
14+
"buildNumber": {
15+
"enabled": true
16+
},
17+
"setVersionVariables": true,
18+
"setAllVariables": true
19+
} ,
20+
"pathFilters": [
21+
":!/.config",
22+
":!/.github",
23+
":!/build",
24+
":!/modules",
25+
":!/storage",
26+
":!/tests",
27+
":!/version.json"
28+
]
29+
}

0 commit comments

Comments
 (0)