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

Commit e7353c7

Browse files
committed
Create releases for tags
Signed-off-by: Scott Andrews <andrewssc@vmware.com>
1 parent 9ea122c commit e7353c7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,36 @@ jobs:
2929
with:
3030
name: knative.js
3131
path: ./dist/knative.js
32+
33+
release:
34+
needs: build
35+
if: startsWith(github.ref, 'refs/tags/')
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v2.3.3
39+
- name: Get release version
40+
id: get-version
41+
run: |
42+
echo ::set-output name=version::$(cat package.json | jq -r .version)
43+
- name: Draft release
44+
id: create_release
45+
uses: actions/create-release@v1.1.4
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: ${{ github.ref }}
50+
release_name: Release ${{ github.ref }}
51+
draft: true
52+
- name: Download staged build
53+
uses: actions/download-artifact@v2.0.5
54+
with:
55+
name: knative.js
56+
- name: Upload release
57+
uses: actions/upload-release-asset@v1.0.2
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, 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
62+
asset_path: knative.js
63+
asset_name: knative-${{ steps.get-version.outputs.version }}.js
64+
asset_content_type: text/javascript

0 commit comments

Comments
 (0)