Skip to content

Commit

Permalink
Update build_release_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor authored Aug 11, 2023
1 parent 5a1736e commit 3a595ef
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions .github/workflows/build_release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,90 @@ name: Build and zip

on:
workflow_dispatch:
push:
tags:
- tc_nightly
- tc_v*

jobs:
build-windows:
build-windows-amd64:
runs-on: windows-latest
outputs:
upload_url: ${{ steps.set_data1.outputs.upload_url }}
steps:

- uses: actions/checkout@v2
with:
submodules: recursive

- name: Build windows
id: build-zip
run: make build
- name: Check windows executable existence
id: check_release
uses: andstor/file-existence-action@v1
with:
files: "./bin/teddybench.exe"
allow_failure: false
- name: File exist
if: steps.check_files.outputs.files_exists == 'true'
run: echo windows release zip exists!
- uses: actions/upload-artifact@master
with:
name: windows-exe
path: /bin/teddybench.exe


build-linux-amd64:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.set_data1.outputs.upload_url }}
appendix: ${{ steps.set_data2.outputs.appendix }}
steps:
- name: Install build dependencies
run: sudo apt-get install -y --no-install-recommends gcc protobuf-c-compiler build-essential
- name: Get current datetime
id: get-datetime
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Set templates for nightly
id: set-templates-nightly
if: startsWith(github.ref, 'refs/tags/tc_nightly')
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}_${{ env.CURRENT_DATE }}_${{ github.run_number }}" >> $GITHUB_ENV
echo "RELEASE_NAME=Nightly ${{ env.CURRENT_DATE }} - Run ID ${{ github.run_number }}" >> $GITHUB_ENV
echo "ASSET_APPENDIX=nightly_${{ env.CURRENT_DATE }}.${{ github.run_number }}" >> $GITHUB_ENV
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
- name: Set templates for release and delete trigger tag
id: set-templates-release
if: startsWith(github.ref, 'refs/tags/tc_v')
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "RELEASE_NAME=Release ${GITHUB_REF#refs/tags/tc_}" >> $GITHUB_ENV
echo "ASSET_APPENDIX=release_${GITHUB_REF#refs/tags/tc_}" >> $GITHUB_ENV
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/download-artifact@master
with:
name: windows-exe
path: /bin/teddybench.exe

- name: Build and zip windows
- name: Build and zip amd64
id: build-zip
run: make zip
- name: Check windows release zip existence
- name: Check amd64 release zip existence
id: check_release
uses: andstor/file-existence-action@v1
with:
files: "./install/zip/release.zip"
allow_failure: true
allow_failure: false
- name: File exist
if: steps.check_files.outputs.files_exists == 'true'
run: echo windows release zip exists!
run: echo amd64 release zip exists!

- name: Create Release
id: create_release
Expand All @@ -58,7 +106,7 @@ jobs:
with:
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
asset_path: ./install/zip/release.zip
asset_name: teddycloud.windows.${{ env.ASSET_APPENDIX }}.zip
asset_name: teddycloud.amd64.${{ env.ASSET_APPENDIX }}.zip
asset_content_type: application/zip
- id: set_data1
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 3a595ef

Please sign in to comment.