Skip to content

Commit 6ac0292

Browse files
committed
fix: Rename artifacts correctly on staging/master
1 parent 0e5d720 commit 6ac0292

File tree

1 file changed

+49
-18
lines changed

1 file changed

+49
-18
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,20 @@ jobs:
5050
name: juno-${{matrix.os}}
5151
path: target/release/juno.exe
5252

53-
release: # Publish release on push to master
54-
if: (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/staging')
53+
release-master: # Publish release on push to master
54+
if: github.ref == 'refs/heads/master'
5555
runs-on: ubuntu-latest
5656
needs: build
5757
steps:
5858
- uses: actions/checkout@v2
5959
- run: git fetch --all --tags
6060

61-
- name: Check Release Version (staging)
62-
if: github.ref == 'refs/heads/staging'
63-
uses: thebongy/version-check@v1
64-
with:
65-
file: Cargo.toml
66-
tagFormat: v${version}-beta
67-
id: version_check_staging
68-
69-
- name: Check Release Version (master)
70-
if: github.ref == 'refs/heads/master'
61+
- name: Check Release Version
7162
uses: thebongy/version-check@v1
7263
with:
7364
file: Cargo.toml
7465
tagFormat: v${version}
75-
id: version_check_master
66+
id: version_check
7667

7768
- name: Download Windows Artifact
7869
uses: actions/download-artifact@v1
@@ -103,17 +94,57 @@ jobs:
10394
uses: softprops/action-gh-release@v1
10495
with:
10596
files: release/**/*
106-
tag_name: ${{steps.version_check_master.outputs.releaseVersion}}
97+
tag_name: ${{steps.version_check.outputs.releaseVersion}}
10798
prerelease: false
10899
env:
109100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110101

111-
- name: Publish Release (staging)
112-
if: github.ref == 'refs/heads/staging'
102+
103+
release-staging:
104+
if: github.ref == 'refs/heads/staging'
105+
runs-on: ubuntu-latest
106+
needs: build
107+
steps:
108+
- uses: actions/checkout@v2
109+
- run: git fetch --all --tags
110+
111+
- name: Check Release Version
112+
uses: thebongy/version-check@v1
113+
with:
114+
file: Cargo.toml
115+
tagFormat: v${version}-beta
116+
id: version_check
117+
118+
- name: Download Windows Artifact
119+
uses: actions/download-artifact@v1
120+
with:
121+
name: juno-windows-latest
122+
path: release/windows
123+
124+
- name: Download MacOS Artifact
125+
uses: actions/download-artifact@v1
126+
with:
127+
name: juno-macos-latest
128+
path: release/macos
129+
130+
- name: Download Linux Artifact
131+
uses: actions/download-artifact@v1
132+
with:
133+
name: juno-ubuntu-latest
134+
path: release/linux
135+
136+
- name: Rename Artifacts
137+
run: |
138+
mv release/windows/juno.exe release/windows/juno-${{steps.version_check.outputs.releaseVersion}}-windows.exe
139+
mv release/macos/juno release/macos/juno-${{steps.version_check.outputs.releaseVersion}}-macos
140+
mv release/linux/juno release/linux/juno-${{steps.version_check.outputs.releaseVersion}}-linux
141+
142+
- name: Publish Release
113143
uses: softprops/action-gh-release@v1
114144
with:
115145
files: release/**/*
116-
tag_name: ${{steps.version_check_staging.outputs.releaseVersion}}
146+
tag_name: ${{steps.version_check.outputs.releaseVersion}}
117147
prerelease: true
118148
env:
119-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150+

0 commit comments

Comments
 (0)