Skip to content

Commit f6817aa

Browse files
Merge pull request #7 from CoolCoderCarl/feature/CI_2
Feature/ci 2
2 parents 38cca8d + 0a1cf75 commit f6817aa

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/build.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
prepare:
1414
name: Prepare env & label
1515
runs-on: ubuntu-latest
16+
outputs:
17+
get_current_tag: ${{ steps.set_current_tag_id.outputs.current_tag }}
1618
steps:
1719

1820
- name: Checkout code
@@ -37,7 +39,7 @@ jobs:
3739

3840
- name: Set tag version to output
3941
id: set_current_tag_id
40-
run: echo "CURRENT_TAG=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_ENV
42+
run: echo "::set-output name=current_tag::${{ steps.tag_version.outputs.new_tag }}"
4143

4244
- name: Notify if failure
4345
if: ${{ failure() }}
@@ -124,7 +126,7 @@ jobs:
124126
125127
<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions">ActionsList</a>
126128
127-
Commit with tag: ${{ env.CURRENT_TAG }}
129+
Commit with tag: ${{ needs.prepare.outputs.get_current_tag }}
128130
129131
Repository: ${{ github.repository }}
130132

.github/workflows/release.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: Set tag version to output
4141
id: set_current_tag_id
42-
run: echo "CURRENT_TAG=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_OUTPUT
42+
run: echo "::set-output name=current_tag::${{ steps.tag_version.outputs.new_tag }}"
4343

4444
- name: Notify if failure
4545
if: ${{ failure() }}
@@ -57,6 +57,8 @@ jobs:
5757
name: Create Release
5858
runs-on: ubuntu-latest
5959
needs: prepare
60+
outputs:
61+
get_release_url: ${{ steps.set_release_url.outputs.release_url }}
6062
steps:
6163

6264
- name: Build Changelog
@@ -74,12 +76,12 @@ jobs:
7476
GITHUB_TOKEN: ${{ secrets.REPOS_TOKEN }}
7577
with:
7678
tag_name: ${{ needs.prepare.outputs.get_current_tag }}
77-
release_name: Release ${{ needs.prepare.outputs.CURRENT_TAG }}
79+
release_name: Release ${{ needs.prepare.outputs.get_current_tag }}
7880
body: ${{ steps.github_release.outputs.changelog }}
7981

8082
- name: Set Release URL
8183
id: set_release_url
82-
run: echo "RELEASE_URL=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV
84+
run: echo "::set-output name=release_url::${{ steps.create_release.outputs.upload_url }}"
8385

8486
- name: Notify if failure
8587
if: ${{ failure() }}
@@ -143,7 +145,7 @@ jobs:
143145
env:
144146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145147
with:
146-
upload_url: ${{ env.RELEASE_URL }}
148+
upload_url: ${{ needs.release.outputs.get_release_url }}
147149
asset_path: ./dist/${{ matrix.OUT_FILE_NAME }}
148150
asset_name: ${{ matrix.OUT_FILE_NAME }}
149151
asset_content_type: ${{ matrix.ASSET_MIME }}
@@ -178,12 +180,12 @@ jobs:
178180
179181
<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions">ActionsList</a>
180182
181-
Commit with tag: ${{ env.CURRENT_TAG }}
183+
Commit with tag: ${{ needs.prepare.outputs.get_current_tag }}
182184
183185
Repository: ${{ github.repository }}
184186
185187
Branch: ${{ github.ref }}
186188
187-
<b>Release URL:</b> https://github.com/${{ github.repository }}/releases/tag/${{ env.CURRENT_TAG }}
189+
<b>Release URL:</b> https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.get_current_tag }}
188190
189191
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }}

0 commit comments

Comments
 (0)