From 01c48a52cafeaad6fea3129e071f7f71988dde4f Mon Sep 17 00:00:00 2001 From: Adam Gardner <26523841+agardnerIT@users.noreply.github.com> Date: Sun, 23 Jul 2023 14:35:50 +1000 Subject: [PATCH] Update build_standalone_binaries.yml --- .../workflows/build_standalone_binaries.yml | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build_standalone_binaries.yml b/.github/workflows/build_standalone_binaries.yml index 34b4d67..98159e7 100644 --- a/.github/workflows/build_standalone_binaries.yml +++ b/.github/workflows/build_standalone_binaries.yml @@ -1,6 +1,10 @@ name: Build Binaries on: workflow_dispatch: + inputs: + version: + type: string + description: "tracepusher version (eg. 0.8.0)" jobs: win_build_binary: @@ -11,33 +15,12 @@ jobs: uses: actions/checkout@v3 with: ref: "main" - - name: Install Python and Pip Packages - uses: actions/setup-python@v4 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2.2.0 with: - python-version: '3.11.4' - cache: 'pip' - - name: "Install Dependencies" - run: pip install -r requirements.txt - - name: "Build Binary" - run: "python -m PyInstaller --onefile tracepusher.py" - - name: "Setup git Config" - run: > - git config user.name "GitHub Actions Bot" && - git config user.email "<>" - - name: "Add Binary to Repo" - run: > - git add dist/tracepusher.exe && - git commit -m "add tracepusher.exe" && - git pull && - git push - linux_x64_build_binary: - name: "[LIN x64] Build Self Contained Binary" - runs-on: ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - ref: "main" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" + aws-region: "ap-southeast-2" - name: Install Python and Pip Packages uses: actions/setup-python@v4 with: @@ -47,16 +30,36 @@ jobs: run: pip install -r requirements.txt - name: "Build Binary" run: "python -m PyInstaller --onefile tracepusher.py" - - name: "Rename file" - run: "mv dist/tracepusher dist/tracepusher_linux_x64" - - name: "Setup git Config" - run: > - git config user.name "GitHub Actions Bot" && - git config user.email "<>" - - name: "Add Binary to Repo" - run: > - git add dist/tracepusher_linux_x64 && - git commit -m "add tracepusher_linux_x64 binary" && - git pull && - git push + - name: "Upload Binary to S3" + run: | + aws s3 cp dist/tracepusher.exe s3://${{ secrets.BUCKET_NAME }}/tracepusher_${{ inputs.version }}.exe +# linux_x64_build_binary: +# name: "[LIN x64] Build Self Contained Binary" +# runs-on: ubuntu-20.04 +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# with: +# ref: "main" +# - name: Install Python and Pip Packages +# uses: actions/setup-python@v4 +# with: +# python-version: '3.11.4' +# cache: 'pip' +# - name: "Install Dependencies" +# run: pip install -r requirements.txt +# - name: "Build Binary" +# run: "python -m PyInstaller --onefile tracepusher.py" +# - name: "Rename file" +# run: "mv dist/tracepusher dist/tracepusher_linux_x64" +# - name: "Setup git Config" +# run: > +# git config user.name "GitHub Actions Bot" && +# git config user.email "<>" +# - name: "Add Binary to Repo" +# run: > +# git add dist/tracepusher_linux_x64 && +# git commit -m "add tracepusher_linux_x64 binary" && +# git pull && +# git push # TODO: Add ARM for MacOS runner when this is available: https://github.com/github/roadmap/issues/528