-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (64 loc) · 2.33 KB
/
on-push-to-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: On push to release
on:
push:
branches: [ release ]
jobs:
test:
runs-on: ubuntu-24.04
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Verify README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: sdk
sdk_language: PHP
dev_docs_slug: php
template_file: ./README.template.md
output_file: ./README.md
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: grpc, protobuf
tools: composer
- name: Install dependencies
run: composer install
- name: Check CS
run: php vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none
- name: Run tests
run: php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml
- name: Run examples
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
working-directory: ./examples
run: |
composer install
php ./example.php
php ./dictionary-example.php
php ./list-example.php
php ./set-example.php
php ./doc-examples-php-apis.php
php ./storage-example.php
php ./psr16-example.php
release:
runs-on: ubuntu-24.04
needs: [ test ]
steps:
- uses: actions/checkout@v4
- name: Set release
id: semrel
uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
allow-initial-development-versions: true
force-bump-patch-version: true
# For whatever reason, this silly tool won't let you do releases from branches
# other than the default branch unless you pass this flag, which doesn't seem
# to actually have anything to do with CI:
# https://github.com/go-semantic-release/semantic-release/blob/master/cmd/semantic-release/main.go#L173-L194
# https://github.com/go-semantic-release/condition-github/blob/4c8af3fc516151423fff2f77eb08bf7082570676/pkg/condition/github.go#L42-L44
custom-arguments: "--no-ci"