|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + - automate-release |
7 | 8 | tags: |
8 | | - - 'v*.*.*' |
| 9 | + - '*.*.*' |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
9 | 13 |
|
10 | 14 | jobs: |
11 | | - release: |
| 15 | + prepare-release: |
12 | 16 | runs-on: ubuntu-latest |
13 | | - needs: build_artifacts # previous jobs that create artifacts |
| 17 | + permissions: |
| 18 | + contents: write |
| 19 | + security-events: write |
| 20 | + |
14 | 21 | steps: |
15 | | - - name: Checkout |
16 | | - uses: actions/checkout@v3 |
| 22 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.0 |
17 | 23 |
|
18 | | - - name: Set up Python |
19 | | - uses: actions/setup-python@v4 |
| 24 | + - name: Setup Python |
| 25 | + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
20 | 26 | with: |
21 | | - python-version: "3.x" |
| 27 | + python-version: '3.13' |
22 | 28 |
|
23 | 29 | - name: Determine release info |
24 | 30 | id: release_info |
25 | 31 | run: | |
26 | 32 | if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then |
27 | 33 | TAG="latest" |
28 | | - RELEASE_NAME="Latest Release" |
29 | | - LATEST_FLAG="--latest" |
30 | 34 | else |
31 | 35 | TAG="${GITHUB_REF#refs/tags/}" |
32 | | - RELEASE_NAME="Release $TAG" |
33 | | - LATEST_FLAG="" |
34 | 36 | fi |
35 | 37 | echo "tag=$TAG" >> $GITHUB_OUTPUT |
36 | | - echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT |
37 | | - echo "latest_flag=$LATEST_FLAG" >> $GITHUB_OUTPUT |
38 | 38 |
|
39 | 39 | - name: Update latest tag |
40 | | - if: github.ref == 'refs/heads/main' |
41 | | - uses: EndBug/latest-tag@v9 |
| 40 | + if: github.ref == 'refs/heads/automate-release' |
| 41 | + uses: EndBug/latest-tag@52ce15b2695f86a4ce47b72387dee54e47f6356c # v1.6.2 |
42 | 42 | with: |
43 | | - tag-name: latest |
| 43 | + ref: latest |
44 | 44 | env: |
45 | 45 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
46 | 46 |
|
47 | 47 | - name: Generate release notes |
48 | 48 | id: notes |
49 | 49 | run: | |
50 | | - notes=$(python create_release_notes.py ${{ steps.release_info.outputs.latest_flag }}) |
51 | | - echo "release_notes<<EOF" >> $GITHUB_OUTPUT |
52 | | - echo "$notes" >> $GITHUB_OUTPUT |
53 | | - echo "EOF" >> $GITHUB_OUTPUT |
| 50 | + python script/create_release_notes.py |
54 | 51 |
|
55 | | - - name: Create/update latest release |
56 | | - if: github.ref == 'refs/heads/main' |
| 52 | + - name: Create release |
57 | 53 | uses: softprops/action-gh-release@v1 |
58 | 54 | with: |
59 | 55 | tag_name: ${{ steps.release_info.outputs.tag }} |
60 | | - name: ${{ steps.release_info.outputs.release_name }} |
61 | | - body: ${{ steps.notes.outputs.release_notes }} |
| 56 | + name: ${{ steps.release_info.outputs.tag }} |
| 57 | + body_text: release_notes.txt |
62 | 58 | draft: true |
| 59 | + overwrite: true |
63 | 60 | env: |
64 | 61 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments