Skip to content

Commit 85ace38

Browse files
authored
Use release plz in CI (#185)
1 parent f805534 commit 85ace38

File tree

2 files changed

+83
-90
lines changed

2 files changed

+83
-90
lines changed

.github/workflows/publish.yml

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

.github/workflows/release-plz.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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: workflow_dispatch
18+
19+
env:
20+
RUST_LOG: debug
21+
CARGO_TERM_COLOR: always
22+
RUST_BACKTRACE: "1"
23+
RUSTFLAGS: "-D warnings"
24+
LLVM_CONFIG_PATH: llvm-config-18
25+
26+
jobs:
27+
# Release unpublished packages.
28+
release-plz-release:
29+
name: Release-plz release
30+
runs-on: ubuntu-latest
31+
if: ${{ github.repository_owner == 'phper-framework' }}
32+
permissions:
33+
contents: write
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
- name: Install Rust toolchain
40+
uses: dtolnay/rust-toolchain@stable
41+
42+
- name: Install libclang
43+
run: sudo apt-get install -y llvm-18-dev libclang-18-dev
44+
45+
- name: Setup PHP
46+
uses: shivammathur/setup-php@v2
47+
with:
48+
php-version: 7.4
49+
tools: php-config
50+
51+
- name: Run release-plz
52+
uses: release-plz/[email protected]
53+
with:
54+
command: release
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
58+
59+
# Create a PR with the new versions and changelog, preparing the next release.
60+
release-plz-pr:
61+
name: Release-plz PR
62+
runs-on: ubuntu-latest
63+
if: ${{ github.repository_owner == 'phper-framework' }}
64+
permissions:
65+
contents: write
66+
pull-requests: write
67+
concurrency:
68+
group: release-plz-${{ github.ref }}
69+
cancel-in-progress: false
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
- name: Install Rust toolchain
76+
uses: dtolnay/rust-toolchain@stable
77+
- name: Run release-plz
78+
uses: release-plz/[email protected]
79+
with:
80+
command: release-pr
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)