|
1 | 1 | --- |
2 | 2 | name: "Release" |
3 | | -# Careful! This pushes a git tag to GitHub! The release itself is private. |
| 3 | +# Creates a draft release. No git tag is pushed; GitHub creates the tag |
| 4 | +# only once the draft release is published. |
4 | 5 | on: |
5 | 6 | workflow_dispatch: |
6 | 7 | inputs: |
7 | 8 | tag: |
8 | 9 | description: > |
9 | | - Tag, which is set by the this GitHub workflow. |
| 10 | + Tag, which the release is associated with. The tag is only |
| 11 | + created once the draft release is published. |
10 | 12 | Should follow SemVer and is not allowed to exist already. |
11 | 13 | required: true |
12 | 14 | type: string |
13 | 15 |
|
14 | 16 | jobs: |
15 | 17 | release: |
16 | 18 | runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: write |
17 | 21 | steps: |
18 | 22 | - uses: actions/checkout@v4 # Determines the ref, which is used for the |
19 | 23 | # release. For setting a different ref, all `needs` jobs need to be |
20 | 24 | # adjusted. Currently, everything uses the default branch. |
21 | 25 |
|
22 | 26 | - run: ls -lh |
23 | 27 |
|
24 | | - - name: "Push release tag" |
25 | | - # This is publicly visible and needs to be manually fixed if any |
26 | | - # consecutive step fails. |
| 28 | + - name: "Create draft release" |
| 29 | + # Fails, if a release for the tag already exists. |
| 30 | + env: |
| 31 | + GH_TOKEN: ${{ github.token }} |
27 | 32 | run: | |
28 | | - git tag ${{ inputs.tag }} # Fails, if tag exists. |
29 | | - git push origin ${{ inputs.tag }} |
30 | | -
|
31 | | - - uses: ncipollo/release-action@v1.13.0 |
32 | | - with: |
33 | | - allowUpdates: false |
34 | | - artifacts: "executables.zip,assets/robotmk_core-1.0.0.mkp" |
35 | | - replacesArtifacts: true |
36 | | - removeArtifacts: true |
37 | | - prerelease: true |
38 | | - draft: true |
39 | | - body: "" |
40 | | - artifactErrorsFailBuild: true |
41 | | - updateOnlyUnreleased: true |
42 | | - makeLatest: false |
43 | | - tag: ${{ inputs.tag }} |
| 33 | + gh release create ${{ inputs.tag }} \ |
| 34 | + --draft \ |
| 35 | + --prerelease \ |
| 36 | + --notes "" \ |
| 37 | + --target ${{ github.sha }} \ |
| 38 | + executables.zip \ |
| 39 | + assets/robotmk_core-1.0.0.mkp |
0 commit comments