Skip to content

Commit c647780

Browse files
authored
Fix .github/workflows/release.yml (#13831)
1 parent 38e9de4 commit c647780

File tree

1 file changed

+47
-18
lines changed

1 file changed

+47
-18
lines changed

.github/workflows/release.yml

+47-18
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,19 @@ jobs:
4343
if: github.ref_type == 'branch'
4444
run: |
4545
ref_name=${{ github.ref_name }}-latest
46+
47+
if ! gh release view $ref_name; then
48+
gh release create \
49+
--latest=false \
50+
--title $ref_name \
51+
--notes "Automated release for latest ${{ github.ref_name }}." \
52+
$ref_name
53+
fi
54+
4655
git tag $ref_name --force
4756
git push origin $ref_name --force
48-
gh release create \
49-
$ref_name \
50-
—-latest=false \
51-
--title $ref_name \
52-
--notes "Automated release for latest ${{ github.ref_name }}." \
53-
|| true
5457
55-
release_pre_built:
58+
build:
5659
needs: create_draft_release
5760
strategy:
5861
fail-fast: true
@@ -70,23 +73,49 @@ jobs:
7073
- uses: actions/checkout@v4
7174
with:
7275
fetch-depth: 50
76+
7377
- uses: ./.github/workflows/release_pre_built
7478
with:
7579
otp_version: ${{ matrix.otp_version }}
7680
otp: ${{ matrix.otp }}
7781
build_docs: ${{ matrix.build_docs }}
82+
7883
- uses: actions/attest-build-provenance@v1
7984
env:
8085
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8186
with:
8287
subject-path: 'elixir-otp-${{ matrix.otp }}.*'
88+
8389
- uses: actions/attest-build-provenance@v1
8490
if: ${{ matrix.build_docs }}
8591
env:
8692
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8793
with:
8894
subject-path: 'Docs.*'
8995

96+
- uses: actions/upload-artifact@v4
97+
with:
98+
name: elixir-otp-${{ matrix.otp }}
99+
path: elixir-otp-${{ matrix.otp }}*
100+
101+
- uses: actions/upload-artifact@v4
102+
if: ${{ matrix.build_docs }}
103+
with:
104+
name: Docs
105+
path: Docs.zip*
106+
107+
upload:
108+
needs: build
109+
runs-on: windows-2022
110+
111+
steps:
112+
- uses: actions/download-artifact@v4
113+
114+
- run: |
115+
mv elixir-otp-*/* .
116+
mv Docs/* .
117+
shell: bash
118+
90119
- name: "Sign files with Trusted Signing"
91120
if: github.repository == 'elixir-lang/elixir'
92121
uses: azure/[email protected]
@@ -104,6 +133,7 @@ jobs:
104133
timestamp-digest: SHA256
105134

106135
- name: Upload Pre-built
136+
shell: bash
107137
env:
108138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109139
run: |
@@ -113,14 +143,13 @@ jobs:
113143
tag="${{ github.ref_name }}"
114144
fi
115145
116-
gh release upload --clobber "$tag" \
117-
elixir-otp-${{ matrix.otp }}.zip \
118-
elixir-otp-${{ matrix.otp }}.zip.sha{1,256}sum \
119-
elixir-otp-${{ matrix.otp }}.exe \
120-
elixir-otp-${{ matrix.otp }}.exe.sha{1,256}sum
121-
122-
if [ "${{ matrix.build_docs }}" == "build_docs" ]; then
123-
gh release upload --clobber "$tag" \
124-
Docs.zip \
125-
Docs.zip.sha{1,256}sum
126-
fi
146+
gh release upload \
147+
--repo ${{ github.repository }} \
148+
--clobber \
149+
"$tag" \
150+
elixir-otp-*.zip \
151+
elixir-otp-*.zip.sha{1,256}sum \
152+
elixir-otp-*.exe \
153+
elixir-otp-*.exe.sha{1,256}sum \
154+
Docs.zip \
155+
Docs.zip.sha{1,256}sum

0 commit comments

Comments
 (0)