Skip to content

Commit

Permalink
Test build windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Aug 11, 2023
1 parent 4c3adca commit 89c71ca
Showing 1 changed file with 51 additions and 7 deletions.
58 changes: 51 additions & 7 deletions .github/workflows/build_release_test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,87 @@
name: Build and zip
name: Build and zip windows/linux

on:
workflow_dispatch:

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 +102,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 89c71ca

Please sign in to comment.