Skip to content

Commit 495e7e5

Browse files
authored
Merge pull request #29 from wusyong/rj
Update release jobs
2 parents 94afc62 + 713e84e commit 495e7e5

File tree

2 files changed

+19
-32
lines changed

2 files changed

+19
-32
lines changed

.github/workflows/release.yml

+5-18
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,7 @@ env:
1616
CARGO_INCREMENTAL: 0
1717

1818
jobs:
19-
release:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- id: tag-name
23-
run: |
24-
if [[ '${{ inputs.release-tag }}' != '' ]]; then
25-
echo "RELEASE_TAG=${{ inputs.release-tag }}" >> ${GITHUB_OUTPUT}
26-
elif [[ '${{ github.event_name }}' == 'release' ]]; then
27-
echo "RELEASE_TAG=${{ github.ref_name }}" >> ${GITHUB_OUTPUT}
28-
fi
29-
outputs:
30-
tag: ${{ steps.tag-name.outputs.RELEASE_TAG }}
31-
32-
verify-artifact:
19+
verify-archive:
3320
strategy:
3421
fail-fast: false
3522
matrix:
@@ -39,20 +26,20 @@ jobs:
3926
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
4027
- { target: x86_64-pc-windows-msvc, os: windows-latest }
4128
runs-on: ${{ matrix.platform.os }}
42-
needs: release
4329
env:
30+
RELEASE_TAG: ${{ github.event_name == 'release' && github.ref_name || inputs.release-tag }}
4431
MOZJS_ARCHIVE: libmozjs-${{ matrix.platform.target }}.tar.gz
4532
steps:
4633
- uses: actions/checkout@v4
4734
- name: Download prebuilt mozjs from artifact
48-
if: ${{ needs.release.outputs.tag == '' }}
35+
if: ${{ env.RELEASE_TAG == '' }}
4936
uses: actions/download-artifact@v4
5037
with:
5138
name: libmozjs-${{ matrix.platform.target }}.tar.gz
5239
- name: Download prebuilt mozjs from release
53-
if: ${{ needs.release.outputs.tag != '' }}
40+
if: ${{ env.RELEASE_TAG != '' }}
5441
run: |
55-
curl -L https://github.com/${{ github.repository_owner }}/mozjs/releases/download/${{ needs.release.outputs.tag }}/libmozjs-${{ matrix.platform.target }}.tar.gz -o libmozjs-${{ matrix.platform.target }}.tar.gz
42+
curl -L https://github.com/${{ github.repository_owner }}/mozjs/releases/download/${{ env.RELEASE_TAG }}/libmozjs-${{ matrix.platform.target }}.tar.gz -o libmozjs-${{ matrix.platform.target }}.tar.gz
5643
- name: Build
5744
run: |
5845
cargo build --verbose --features streams

.github/workflows/rust.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -189,20 +189,6 @@ jobs:
189189
run: |
190190
git diff --staged --no-ext-diff --quiet --exit-code
191191
192-
build_result:
193-
name: Result
194-
runs-on: ubuntu-latest
195-
needs:
196-
["android", "linux", "linux-cross-compile", "mac", "windows", "integrity", "publish-release", "verify-release"]
197-
if: ${{ always() }}
198-
steps:
199-
- name: Mark the job as successful
200-
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
201-
run: exit 0
202-
- name: Mark the job as unsuccessful
203-
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
204-
run: exit 1
205-
206192
publish-release:
207193
name: Publish release
208194
runs-on: ubuntu-latest
@@ -231,3 +217,17 @@ jobs:
231217
with:
232218
release-tag: ${{ needs.publish-release.outputs.release-tag }}
233219

220+
build_result:
221+
name: Result
222+
runs-on: ubuntu-latest
223+
needs:
224+
["android", "linux", "linux-cross-compile", "mac", "windows", "integrity", "publish-release", "verify-release"]
225+
if: ${{ always() }}
226+
steps:
227+
- name: Mark the job as successful
228+
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
229+
run: exit 0
230+
- name: Mark the job as unsuccessful
231+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
232+
run: exit 1
233+

0 commit comments

Comments
 (0)