Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit a391885

Browse files
committed
WIP: release using GH UI
1 parent b6d2bf1 commit a391885

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191

192192
release:
193193
if: startsWith( github.ref, 'refs/tags/v')
194-
name: Create release
194+
name: Add artifact to release
195195

196196
runs-on: ubuntu-latest
197197
needs: ["coding-guidelines", "unit"]
@@ -231,37 +231,21 @@ jobs:
231231
name: commercetools-php-sdk-${{ steps.branch_name.outputs.SOURCE_TAG }}.phar
232232
path: commercetools-php-sdk.phar
233233

234-
- name: Read changeset
235-
id: changeset
236-
run: |
237-
CHANGESET=`php tools/extract_changelog.php`
238-
CHANGESET="${CHANGESET//'%'/'%25'}"
239-
CHANGESET="${CHANGESET//$'\n'/'%0A'}"
240-
CHANGESET="${CHANGESET//$'\r'/'%0D'}"
241-
echo "::set-output name=changes::$CHANGESET"
242-
243-
- name: Create Release
244-
id: create_release
245-
uses: actions/create-release@v1
234+
- name: Get release data
235+
id: retrieve_release
246236
env:
247-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
248-
with:
249-
tag_name: ${{ github.ref }}
250-
release_name: ${{ github.ref }}
251-
draft: true
252-
prerelease: false
253-
body: |
254-
${{ steps.changeset.outputs.changes }}
237+
GITHUB_TOKEN: ${{ secrets.token }}
238+
run: |
239+
gh api repos/commercetools/commercetools-php-sdk/releases/tags/$SOURCE_TAG > release_data.json
240+
echo 'UPLOAD_URL='$(jq '.upload_url' release_data.json) >> $GITHUB_ENV
255241
256242
- name: Upload Release Asset
257243
id: upload-release-asset
258244
uses: actions/upload-release-asset@v1
259245
env:
260246
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
261247
with:
262-
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object,
263-
# which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
264-
upload_url: ${{ steps.create_release.outputs.upload_url }}
248+
upload_url: ${{ env.UPLOAD_URL }}
265249
asset_path: ./commercetools-php-sdk.phar
266250
asset_name: commercetools-php-sdk.phar
267251
asset_content_type: application/php-archive

0 commit comments

Comments
 (0)