Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Platform specific bundles | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
name: build linux binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
# build image which builds the bundle for glibc 2.15+ | |
docker build --file backend/Dockerfile-github-workflow-bundle --tag config-assessment-tool-linux . | |
echo "finished building docker image with bundle included" | |
# copy bundle out of built image | |
tarball_path=$(docker run --rm config-assessment-tool-linux:latest find /root/config-assessment-tool/dist/ -name *.tgz) | |
echo "copying bundle out of image using $tarball_path" | |
docker cp $(docker create --name temp_image config-assessment-tool-linux:latest):$tarball_path ./ && docker rm temp_image | |
echo "finished copying bundle onto hosted runner at $(pwd)" | |
echo "files in current directory $(ls -altr)" | |
- name: Release the bundle for linux | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./*.tgz | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Keep workflow artifact within the current workflow namespace | |
uses: actions/upload-artifact@v3 | |
with: | |
name: config-assessment-tool-linux.tgz | |
path: ./config-assessment-tool-linux-*.tgz | |
if-no-files-found: ignore | |
build-win: | |
name: build windows binary | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Python 3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv pyinstaller | |
# install to global namespace and then clean up, no need for venv setup | |
pipenv install --dev --system | |
- name: Use pip installation to get around github hosted windows runner path issues | |
id: install_it | |
shell: pwsh | |
run: | | |
pipenv requirements --dev > requirements.txt | |
pip install -r requirements.txt | |
pyinstaller --distpath=./dist/appdynamics backend/config-assessment-tool.spec | |
cd dist | |
$bundleFileDir = Get-ChildItem ./appdynamics/config* | select Name | |
$bundleFileDirName = $bundleFileDir.Name | |
7z a "$bundleFileDirName.zip" ./appdynamics -xr!logs | |
echo "::set-output name=bundle_name::$bundleFileDirName.zip" | |
- name: Release the bundle for Windows | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: dist/${{ steps.install_it.outputs.bundle_name }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Keep workflow artifact within the current workflow namespace | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.install_it.outputs.bundle_name }} | |
path: dist/${{ steps.install_it.outputs.bundle_name }} | |
if-no-files-found: ignore |