Skip to content

Commit

Permalink
Add workflow logic to create artifact on release
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiaanOlij committed Jun 22, 2021
1 parent 2ac8aa3 commit 6bf60c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
name: Assembling the asset (artifact)
runs-on: ubuntu-20.04
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -130,6 +130,15 @@ jobs:
- name: Zip asset
run: |
zip -qq -r godot-openxr.zip .
- name: Create and upload asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "godot-openxr.zip"
body: "New release!"
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags')
- name: Create release for asset
id: create_release
uses: actions/create-release@v1
Expand All @@ -142,6 +151,7 @@ jobs:
This is an automated build for changeset ${{ env.GITHUB_SHA_SHORT }}
draft: false
prerelease: true
if: github.ref == 'refs/heads/master'
- name: Upload asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
Expand All @@ -152,3 +162,4 @@ jobs:
asset_path: ./godot-openxr.zip
asset_name: godot-openxr.zip
asset_content_type: application/zip
if: github.ref == 'refs/heads/master'

0 comments on commit 6bf60c1

Please sign in to comment.