Skip to content

Commit 8357352

Browse files
committed
Use release plz in CI
1 parent 4d2ad76 commit 8357352

File tree

2 files changed

+86
-90
lines changed

2 files changed

+86
-90
lines changed

.github/workflows/publish.yml

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

.github/workflows/release-plz.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Copyright (c) 2022 PHPER Framework Team
2+
# PHPER is licensed under Mulan PSL v2.
3+
# You can use this software according to the terms and conditions of the Mulan
4+
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
5+
# http://license.coscl.org.cn/MulanPSL2
6+
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
7+
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
8+
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9+
# See the Mulan PSL v2 for more details.
10+
11+
name: Release-plz
12+
13+
permissions:
14+
pull-requests: write
15+
contents: write
16+
17+
on:
18+
push:
19+
branches:
20+
- master
21+
22+
env:
23+
RUST_LOG: debug
24+
CARGO_TERM_COLOR: always
25+
RUST_BACKTRACE: "1"
26+
RUSTFLAGS: "-D warnings"
27+
LLVM_CONFIG_PATH: llvm-config-18
28+
29+
jobs:
30+
# Release unpublished packages.
31+
release-plz-release:
32+
name: Release-plz release
33+
runs-on: ubuntu-latest
34+
if: ${{ github.repository_owner == 'phper-framework' }}
35+
permissions:
36+
contents: write
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
- name: Install Rust toolchain
43+
uses: dtolnay/rust-toolchain@stable
44+
45+
- name: Install libclang
46+
run: sudo apt-get install -y llvm-18-dev libclang-18-dev
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: 7.4
52+
tools: php-config
53+
54+
- name: Run release-plz
55+
uses: release-plz/[email protected]
56+
with:
57+
command: release
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
61+
62+
# Create a PR with the new versions and changelog, preparing the next release.
63+
release-plz-pr:
64+
name: Release-plz PR
65+
runs-on: ubuntu-latest
66+
if: ${{ github.repository_owner == 'phper-framework' }}
67+
permissions:
68+
contents: write
69+
pull-requests: write
70+
concurrency:
71+
group: release-plz-${{ github.ref }}
72+
cancel-in-progress: false
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 0
78+
- name: Install Rust toolchain
79+
uses: dtolnay/rust-toolchain@stable
80+
- name: Run release-plz
81+
uses: release-plz/[email protected]
82+
with:
83+
command: release-pr
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)