|
9 | 9 | release: |
10 | 10 | name: Create GitHub Release |
11 | 11 | runs-on: ubuntu-latest |
| 12 | + outputs: |
| 13 | + release_id: ${{ steps.create_release.outputs.id }} |
| 14 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
12 | 15 | steps: |
13 | 16 | - uses: actions/checkout@v2 |
14 | 17 | with: |
|
33 | 36 | release_name: ${{ steps.create_tag.outputs.tag }} |
34 | 37 | draft: true |
35 | 38 | prerelease: false |
36 | | - - name: Create artifact files |
37 | | - run: | |
38 | | - mkdir info |
39 | | - echo "${{ steps.create_release.outputs.id }}" > info/release_id |
40 | | - echo "${{ steps.create_release.outputs.upload_url }}" > info/upload_url |
41 | | - - uses: actions/upload-artifact@v1 |
42 | | - with: |
43 | | - name: info |
44 | | - path: info |
45 | 39 |
|
46 | 40 | build: |
47 | 41 | needs: [release] |
|
52 | 46 | name: [ head, debug ] |
53 | 47 | runs-on: ${{ matrix.os }} |
54 | 48 | steps: |
55 | | - - uses: actions/download-artifact@v1 |
56 | | - with: |
57 | | - name: info |
58 | | - - name: Set upload_url |
59 | | - id: upload_info |
60 | | - run: | |
61 | | - upload_url=$(cat info/upload_url) |
62 | | - echo "::set-output name=upload_url::$upload_url" |
63 | 49 | - name: Set platform |
64 | 50 | id: platform |
65 | 51 | run: | |
@@ -137,29 +123,21 @@ jobs: |
137 | 123 | env: |
138 | 124 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
139 | 125 | with: |
140 | | - upload_url: ${{ steps.upload_info.outputs.upload_url }} |
| 126 | + upload_url: ${{ needs.release.outputs.upload_url }} |
141 | 127 | asset_path: ruby-${{ matrix.name }}-${{ steps.platform.outputs.platform }}.tar.gz |
142 | 128 | asset_name: ruby-${{ matrix.name }}-${{ steps.platform.outputs.platform }}.tar.gz |
143 | 129 | asset_content_type: application/gzip |
144 | 130 |
|
145 | 131 | metadata: |
146 | 132 | name: Publish Release |
147 | | - needs: [build] |
| 133 | + needs: [release, build] |
148 | 134 | runs-on: ubuntu-latest |
149 | 135 | steps: |
150 | | - - uses: actions/download-artifact@v1 |
151 | | - with: |
152 | | - name: info |
153 | | - - name: Set publish_info |
154 | | - id: publish_info |
155 | | - run: | |
156 | | - release_id=$(cat info/release_id) |
157 | | - echo "::set-output name=release_id::$release_id" |
158 | 136 | - uses: eregon/publish-release@v1 |
159 | 137 | env: |
160 | 138 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
161 | 139 | with: |
162 | | - release_id: ${{ steps.publish_info.outputs.release_id }} |
| 140 | + release_id: ${{ needs.release.outputs.release_id }} |
163 | 141 | - uses: eregon/keep-last-n-releases@v1 |
164 | 142 | env: |
165 | 143 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
0 commit comments