Skip to content

Commit 47db688

Browse files
authored
Merge pull request #152 from BastiaanOlij/change_release_ci
Change release CI to only build on tag
2 parents 646245e + 2e5cfc6 commit 47db688

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

.github/workflows/build-on-push.yml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
name: Assemble release bundle
7171
runs-on: ubuntu-20.04
7272
needs: build
73-
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))
73+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
7474

7575
# Steps represent a sequence of tasks that will be executed as part of the job
7676
steps:
@@ -86,16 +86,10 @@ jobs:
8686
uses: actions/download-artifact@v4
8787
with:
8888
path: godot_openvr_plugin/addons/godot-openvr/bin/
89-
- name: Calculate GIT short ref
90-
run: |
91-
cd godot_openvr
92-
echo "GITHUB_SHA_SHORT=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
93-
if: github.ref == 'refs/heads/master'
9489
- name: Get tag name
9590
run: |
9691
cd godot_openvr
9792
echo "GITHUB_SHA_SHORT=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
98-
if: startsWith(github.ref, 'refs/tags')
9993
- name: Clean up extracted files
10094
run: |
10195
rm -rf godot_openvr
@@ -108,34 +102,7 @@ jobs:
108102
with:
109103
allowUpdates: true
110104
artifacts: "godot-openvr.zip"
111-
body: "A new release!"
112-
prerelease: false
105+
omitNameDuringUpdate: true
106+
omitBodyDuringUpdate: true
113107
token: ${{ secrets.GITHUB_TOKEN }}
114108
if: startsWith(github.ref, 'refs/tags')
115-
116-
# TODO: Both create-release and upload-release-asset are abandonded, need to port to maintained replacements. Both suggest replacements in their README.
117-
118-
- name: Create release for asset
119-
id: create_release
120-
uses: actions/create-release@v1
121-
env:
122-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123-
with:
124-
tag_name: ${{ env.GITHUB_SHA_SHORT }}
125-
release_name: Automatic build for changeset ${{ env.GITHUB_SHA_SHORT }}
126-
body: |
127-
This is an automated build for changeset ${{ env.GITHUB_SHA_SHORT }}
128-
draft: false
129-
prerelease: true
130-
if: github.ref == 'refs/heads/master'
131-
- name: Upload asset
132-
id: upload-release-asset
133-
uses: actions/upload-release-asset@v1
134-
env:
135-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136-
with:
137-
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
138-
asset_path: ./godot-openvr.zip
139-
asset_name: godot-openvr.zip
140-
asset_content_type: application/zip
141-
if: github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)