|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 |
|
10 | | - # First register a new release we can attach files to. |
11 | | - create-release: |
12 | | - name: create-release |
13 | | - runs-on: ubuntu-latest |
14 | | - outputs: |
15 | | - version: ${{ steps.release_version.outputs.version }} |
16 | | - upload_url: ${{ steps.release.outputs.upload_url }} |
17 | | - steps: |
18 | | - # Yes, we really need to get the plain tag name like this. There are even |
19 | | - # dedicated actions for it. |
20 | | - # https://stackoverflow.com/a/58178121/482758 |
21 | | - - name: Share release version |
22 | | - id: release_version |
23 | | - run: printf '::set-output name=version::%s\n' "${GITHUB_REF#refs/tags/}" |
24 | | - |
25 | | - - name: Publish new release |
26 | | - id: release |
27 | | - uses: actions/create-release@v1 |
28 | | - env: |
29 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
30 | | - with: |
31 | | - tag_name: ${{ steps.release_version.outputs.version }} |
32 | | - release_name: ${{ steps.release_version.outputs.version }} |
33 | | - |
34 | 10 | build-package: |
35 | 11 | name: build-package |
36 | | - needs: |
37 | | - - create-release |
38 | 12 | runs-on: ${{ matrix.os }} |
39 | 13 | strategy: |
40 | 14 | matrix: |
|
71 | 45 | run: | |
72 | 46 | printf 'TARGET_FLAGS=--target %s\n' "${{ matrix.target }}" >> $GITHUB_ENV |
73 | 47 | printf 'TARGET_DIR=./target/${{ matrix.target }}\n' >> $GITHUB_ENV |
74 | | - printf 'RELEASE_URL=%s\n' "${{ needs.create-release.outputs.upload_url }}" >> $GITHUB_ENV |
75 | | - printf 'RELEASE_VERSION=%s\n' "${{ needs.create-release.outputs.version }}" >> $GITHUB_ENV |
| 48 | + printf 'RELEASE_VERSION=%s\n' "${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
76 | 49 | printf 'RELEASE_BINARY=%s\n' "target/${{ matrix.target }}/release/commitmsgfmt${{ matrix.binary_ext }}" >> $GITHUB_ENV |
77 | 50 |
|
78 | 51 | # So much cruft just to install Asciidoctor. |
@@ -135,11 +108,8 @@ jobs: |
135 | 108 | fi |
136 | 109 |
|
137 | 110 | - name: Upload package |
138 | | - |
139 | | - env: |
140 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + uses: softprops/action-gh-release@v1 |
141 | 112 | with: |
142 | | - upload_url: ${{ env.RELEASE_URL }} |
143 | | - asset_path: ${{ env.ASSET }} |
144 | | - asset_name: ${{ env.ASSET }} |
145 | | - asset_content_type: application/octet-stream |
| 113 | + draft: true |
| 114 | + tag_name: ${{ env.RELEASE_VERSION }} |
| 115 | + files: ${{ env.ASSET }} |
0 commit comments