Skip to content

Commit 29ba826

Browse files
Updated workflows to shared versions
1 parent 858378f commit 29ba826

File tree

5 files changed

+21
-172
lines changed

5 files changed

+21
-172
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: CI
23

34
on:
@@ -15,40 +16,7 @@ on:
1516
- '**.md'
1617

1718
jobs:
18-
test_latest:
19-
strategy:
20-
matrix:
21-
php-versions: [ '8.0' ]
22-
prefer: [ 'prefer-lowest', 'prefer-stable' ]
23-
name: Test with ${{ matrix.prefer }} dependency versions on PHP ${{ matrix.php-versions }}
24-
runs-on: ubuntu-latest
25-
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v2
29-
30-
- name: Setup PHP
31-
uses: shivammathur/setup-php@v2
32-
with:
33-
php-version: ${{ matrix.php-versions }}
34-
coverage: xdebug
35-
36-
- name: Validate composer.json
37-
run: composer validate
38-
39-
- name: Get Composer Cache Directory
40-
id: composer-cache
41-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42-
- name: Setup cache
43-
uses: actions/cache@v2
44-
with:
45-
path: ${{ steps.composer-cache.outputs.dir }}
46-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
47-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
48-
49-
- name: Install dependencies
50-
if: steps.composer-cache.outputs.cache-hit != 'true'
51-
run: composer update --prefer-dist --no-ansi --no-interaction --no-progress --${{ matrix.prefer }}
52-
53-
- name: Run CI tools
54-
run: composer ci-all
19+
ci:
20+
uses: codenamephp/workflows.php/.github/workflows/ci.yml@main
21+
with:
22+
php-versions: '["8.1"]'

.github/workflows/post-release.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/prepare-release.yml

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,16 @@ on:
77

88
jobs:
99
calculate_next_version:
10-
name: Calculate next release version
11-
runs-on: ubuntu-latest
12-
outputs:
13-
version: ${{ steps.version.outputs.next-version }}
14-
steps:
15-
- name: calculate next version
16-
id: version
17-
uses: patrickjahns/version-drafter-action@v1
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
10+
uses: codenamephp/workflows.common/.github/workflows/calculate-next-version.yml@main
2111
draft_release:
22-
name: Create draft release
23-
runs-on: ubuntu-latest
2412
needs: calculate_next_version
25-
steps:
26-
- name: draft release
27-
uses: release-drafter/release-drafter@v5
28-
with:
29-
version: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
30-
tag: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
31-
name: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
13+
uses: codenamephp/workflows.common/.github/workflows/draft-release.yml@main
14+
with:
15+
version: ${{ needs.calculate_next_version.outputs.version }}
3516
update_changelog:
36-
name: Update changelog
37-
runs-on: ubuntu-latest
17+
uses: codenamephp/workflows.common/.github/workflows/update-changelog.yml@main
3818
needs: calculate_next_version
39-
steps:
40-
- name: checkout
41-
uses: actions/checkout@v2
42-
43-
- name: create changelog
44-
uses: charmixer/[email protected]
45-
with:
46-
token: ${{ secrets.GITHUB_TOKEN }}
47-
exclude_labels: "duplicate,question,invalid,wontfix,skip-changelog"
48-
future_release: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
49-
release_branch: 'release'
50-
51-
- name: commit updated changelog
52-
uses: EndBug/add-and-commit@v7
53-
with:
54-
message: "[CHANGELOG] Updated changelog"
55-
add: "CHANGELOG.md"
56-
signoff: true
19+
with:
20+
ref: ${{github.ref_name}}
21+
future_release: ${{ needs.calculate_next_version.outputs.version }}
22+
release_branch: 'release'

.github/workflows/update-changelog.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@ on:
77

88
jobs:
99
update_changelog:
10-
name: Update changelog
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v2
15-
16-
- name: create changelog
17-
uses: charmixer/auto-changelog-action@v1
18-
with:
19-
token: ${{ secrets.GITHUB_TOKEN }}
20-
exclude_labels: "duplicate,question,invalid,wontfix,skip-changelog"
21-
22-
- name: commit updated changelog
23-
uses: EndBug/add-and-commit@v7
24-
with:
25-
message: "[CHANGELOG] Updated changelog"
26-
add: "CHANGELOG.md"
27-
signoff: true
10+
uses: codenamephp/workflows.common/.github/workflows/update-changelog.yml@main
11+
with:
12+
ref: ${{github.ref_name}}

.installer/templates/.github/workflows/ci.yml

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,8 @@ on:
1616
- '**.md'
1717

1818
jobs:
19-
test_latest:
20-
strategy:
21-
matrix:
22-
{% endverbatim %}php-versions: [ '{{phpVersion}}' ]{% verbatim %}
23-
prefer: [ 'prefer-lowest', 'prefer-stable' ]
24-
name: Test with ${{ matrix.prefer }} dependency versions on PHP ${{ matrix.php-versions }}
25-
runs-on: ubuntu-latest
26-
27-
steps:
28-
- name: Checkout
29-
uses: actions/checkout@v2
30-
31-
- name: Setup PHP
32-
uses: shivammathur/setup-php@v2
33-
with:
34-
php-version: ${{ matrix.php-versions }}
35-
coverage: xdebug
36-
37-
- name: Validate composer.json
38-
run: composer validate
39-
40-
- name: Get Composer Cache Directory
41-
id: composer-cache
42-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
43-
- name: Setup cache
44-
uses: actions/cache@v2
45-
with:
46-
path: ${{ steps.composer-cache.outputs.dir }}
47-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
48-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
49-
50-
- name: Install dependencies
51-
if: steps.composer-cache.outputs.cache-hit != 'true'
52-
run: composer update --prefer-dist --no-ansi --no-interaction --no-progress --${{ matrix.prefer }}
53-
54-
- name: Run CI tools
55-
run: composer ci-all
19+
ci:
20+
uses: codenamephp/workflows.php/.github/workflows/ci.yml@main
21+
with:
22+
php-versions: '["{% endverbatim %}{{phpVersion}}{% verbatim %}"]'
5623
{% endverbatim %}

0 commit comments

Comments
 (0)