|
1 | | -name: Release Create |
| 1 | +name: Release Please |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - types: [closed] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
6 | 7 |
|
7 | | -env: |
8 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 8 | +permissions: |
| 9 | + contents: read |
9 | 10 |
|
10 | 11 | jobs: |
11 | | - check-release-conditions: |
| 12 | + release-please: |
12 | 13 | runs-on: ubuntu-latest |
13 | | - if: | |
14 | | - github.event.pull_request.merged == true && |
15 | | - github.event.pull_request.base.ref == 'main' && |
16 | | - startsWith(github.event.pull_request.head.ref, 'release/v') && |
17 | | - startsWith(github.event.pull_request.user.login, 'github-actions') |
18 | | -
|
| 14 | + permissions: |
| 15 | + contents: write |
| 16 | + pull-requests: write |
| 17 | + outputs: |
| 18 | + release_created: ${{ steps.release.outputs.release_created }} |
| 19 | + release_tag: ${{ steps.release.outputs.tag_name }} |
19 | 20 | steps: |
20 | | - - name: Check release conditions |
21 | | - run: | |
22 | | - echo "All conditions have been met!" |
| 21 | + - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0 |
| 22 | + id: release |
23 | 23 |
|
24 | 24 | create-release: |
25 | 25 | permissions: |
26 | 26 | contents: write |
27 | | - needs: check-release-conditions |
| 27 | + needs: release-please |
| 28 | + if: ${{ needs.release-please.outputs.release_created }} |
28 | 29 | runs-on: ubuntu-latest |
29 | 30 |
|
30 | | - env: |
31 | | - NEXT_RELEASE_TAG: ${{ github.event.pull_request.head.ref }} |
32 | 31 | steps: |
33 | 32 | - name: Checkout |
34 | | - uses: actions/checkout@v4 |
35 | | - |
36 | | - - name: Prepare Python |
37 | | - uses: actions/setup-python@v5 |
| 33 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
38 | 34 | with: |
39 | | - cache: 'pip' |
40 | | - |
41 | | - - name: Install dependencies |
42 | | - run: pip install -r ./tools/release/requirements.txt |
43 | | - |
44 | | - - name: Extract Tag from branch name |
45 | | - run: | |
46 | | - NEXT_RELEASE_TAG=$(echo $NEXT_RELEASE_TAG | sed 's/^release\///') |
47 | | - echo "NEXT_RELEASE_TAG=${NEXT_RELEASE_TAG}" >> $GITHUB_ENV |
48 | | -
|
49 | | - - name: Target release Tag |
50 | | - run: echo "New tag $NEXT_RELEASE_TAG" |
| 35 | + persist-credentials: false |
51 | 36 |
|
52 | 37 | - name: Setup Ninja |
53 | 38 | run: sudo apt-get install ninja-build |
|
65 | 50 | cp merve.h merve.cpp ../../singleheader/ |
66 | 51 |
|
67 | 52 | - name: Create release |
68 | | - run: ./tools/release/create_release.py |
| 53 | + run: gh release upload "$RELEASE_TAG" singleheader/* |
| 54 | + env: |
| 55 | + GH_TOKEN: ${{ github.token }} |
| 56 | + RELEASE_TAG: ${{ needs.release-please.outputs.release_tag }} |
0 commit comments