Skip to content

Commit e28e39c

Browse files
committed
ci: replace deprecated gh/{create,upload}-release* actions
Note that the substitute action reports the new release as a bogus tag .../releases/tag/untagged-*, including asset download URLs. This may or may not be a draft artifact. In any case, when the draft is published the URLs correct to the specified tag and all remain operational.
1 parent be34c3d commit e28e39c

File tree

1 file changed

+5
-35
lines changed

1 file changed

+5
-35
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,8 @@ on:
77

88
jobs:
99

10-
# First register a new release we can attach files to.
11-
create-release:
12-
name: create-release
13-
runs-on: ubuntu-latest
14-
outputs:
15-
version: ${{ steps.release_version.outputs.version }}
16-
upload_url: ${{ steps.release.outputs.upload_url }}
17-
steps:
18-
# Yes, we really need to get the plain tag name like this. There are even
19-
# dedicated actions for it.
20-
# https://stackoverflow.com/a/58178121/482758
21-
- name: Share release version
22-
id: release_version
23-
run: printf '::set-output name=version::%s\n' "${GITHUB_REF#refs/tags/}"
24-
25-
- name: Publish new release
26-
id: release
27-
uses: actions/create-release@v1
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
with:
31-
tag_name: ${{ steps.release_version.outputs.version }}
32-
release_name: ${{ steps.release_version.outputs.version }}
33-
3410
build-package:
3511
name: build-package
36-
needs:
37-
- create-release
3812
runs-on: ${{ matrix.os }}
3913
strategy:
4014
matrix:
@@ -71,8 +45,7 @@ jobs:
7145
run: |
7246
printf 'TARGET_FLAGS=--target %s\n' "${{ matrix.target }}" >> $GITHUB_ENV
7347
printf 'TARGET_DIR=./target/${{ matrix.target }}\n' >> $GITHUB_ENV
74-
printf 'RELEASE_URL=%s\n' "${{ needs.create-release.outputs.upload_url }}" >> $GITHUB_ENV
75-
printf 'RELEASE_VERSION=%s\n' "${{ needs.create-release.outputs.version }}" >> $GITHUB_ENV
48+
printf 'RELEASE_VERSION=%s\n' "${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
7649
printf 'RELEASE_BINARY=%s\n' "target/${{ matrix.target }}/release/commitmsgfmt${{ matrix.binary_ext }}" >> $GITHUB_ENV
7750
7851
# So much cruft just to install Asciidoctor.
@@ -135,11 +108,8 @@ jobs:
135108
fi
136109
137110
- name: Upload package
138-
uses: actions/[email protected]
139-
env:
140-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
uses: softprops/action-gh-release@v1
141112
with:
142-
upload_url: ${{ env.RELEASE_URL }}
143-
asset_path: ${{ env.ASSET }}
144-
asset_name: ${{ env.ASSET }}
145-
asset_content_type: application/octet-stream
113+
draft: true
114+
tag_name: ${{ env.RELEASE_VERSION }}
115+
files: ${{ env.ASSET }}

0 commit comments

Comments
 (0)