Skip to content

Commit dfa533d

Browse files
committed
Refactor to use job outputs
1 parent e06ddad commit dfa533d

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

Diff for: .github/workflows/build.yml

+6-31
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
release:
1010
name: Create GitHub Release
1111
runs-on: ubuntu-latest
12+
outputs:
13+
release_id: ${{ steps.create_release.outputs.id }}
14+
upload_url: ${{ steps.create_release.outputs.upload_url }}
1215
steps:
1316
- uses: actions/checkout@v2
1417
with:
@@ -34,16 +37,6 @@ jobs:
3437
release_name: ${{ steps.create_tag.outputs.tag }}
3538
draft: true
3639
prerelease: false
37-
- name: Create artifact files
38-
shell: bash
39-
run: |
40-
mkdir info
41-
echo "${{ steps.create_release.outputs.id }}" > info/release_id
42-
echo "${{ steps.create_release.outputs.upload_url }}" > info/upload_url
43-
- uses: actions/upload-artifact@v1
44-
with:
45-
name: info
46-
path: info
4740

4841
build:
4942
needs: [release]
@@ -53,15 +46,6 @@ jobs:
5346
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019 ]
5447
runs-on: ${{ matrix.os }}
5548
steps:
56-
- uses: actions/download-artifact@v1
57-
with:
58-
name: info
59-
- name: Set upload_url
60-
id: upload_info
61-
shell: bash
62-
run: |
63-
upload_url=$(cat info/upload_url)
64-
echo "::set-output name=upload_url::$upload_url"
6549
- name: Set platform
6650
id: platform
6751
shell: bash
@@ -141,30 +125,21 @@ jobs:
141125
env:
142126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143127
with:
144-
upload_url: ${{ steps.upload_info.outputs.upload_url }}
128+
upload_url: ${{ needs.release.outputs.upload_url }}
145129
asset_path: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz
146130
asset_name: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz
147131
asset_content_type: application/gzip
148132

149133
metadata:
150134
name: Publish Release
151-
needs: [build]
135+
needs: [release, build]
152136
runs-on: ubuntu-latest
153137
steps:
154-
- uses: actions/download-artifact@v1
155-
with:
156-
name: info
157-
- name: Set publish_info
158-
id: publish_info
159-
shell: bash
160-
run: |
161-
release_id=$(cat info/release_id)
162-
echo "::set-output name=release_id::$release_id"
163138
- uses: eregon/publish-release@v1
164139
env:
165140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166141
with:
167-
release_id: ${{ steps.publish_info.outputs.release_id }}
142+
release_id: ${{ needs.release.outputs.release_id }}
168143
- uses: eregon/keep-last-n-releases@v1
169144
env:
170145
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)