ci_release: build exe without upload on PR

This commit is contained in:
scito 2023-01-30 14:26:08 +01:00 committed by Roland Kurmann
parent 861d7d0da8
commit 5c36f07f41

View File

@ -44,10 +44,10 @@ jobs:
create-release: create-release:
name: Create Release name: Create Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps: steps:
- name: Set meta data - name: Set meta data
id: meta id: meta
if: startsWith(github.ref, 'refs/tags/v')
# Writing to env with >> $GITHUB_ENV is an alternative # Writing to env with >> $GITHUB_ENV is an alternative
run: | run: |
echo "date=$(TZ=Europe/Zurich date +'%d.%m.%Y')" >> $GITHUB_OUTPUT echo "date=$(TZ=Europe/Zurich date +'%d.%m.%Y')" >> $GITHUB_OUTPUT
@ -58,6 +58,7 @@ jobs:
TAG_NAME: ${{ github.ref_name }} TAG_NAME: ${{ github.ref_name }}
- name: Create Release - name: Create Release
id: create_release id: create_release
if: startsWith(github.ref, 'refs/tags/v')
run: | run: |
# https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release # https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release
response=$(curl \ response=$(curl \
@ -73,11 +74,13 @@ jobs:
echo $(jq -r '.upload_url' <<< "$response") > release_url.txt echo $(jq -r '.upload_url' <<< "$response") > release_url.txt
echo $(jq -r '.id' <<< "$response") > release_id.txt echo $(jq -r '.id' <<< "$response") > release_id.txt
- name: Save Release URL File for publish - name: Save Release URL File for publish
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: release_url name: release_url
path: release_url.txt path: release_url.txt
- name: Save asset upload id for publish - name: Save asset upload id for publish
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: release_id name: release_id