Release Generator #88
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: Release Generator | |
on: | |
workflow_run: | |
workflows: ["Release"] | |
types: | |
- completed | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build_dmg: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Build DMG | |
run: | | |
chmod +x build_scripts/openai/macos_build.sh | |
./build_scripts/openai/macos_build.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: gpt-computer-assistant-openai-dmg | |
path: dist/*.dmg | |
build_exe: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Build EXE | |
run: | | |
sh build_scripts/openai/windows_build.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: gpt-computer-assistant-openai-exe | |
path: dist/*.exe | |
release: | |
needs: [build_dmg, build_exe] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Getting Tag | |
id: tag_extractor | |
run: echo "latest_tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT" | |
- uses: ncipollo/release-action@v1 | |
id: create_release | |
with: | |
name: GPT Computer Assistant ${{ steps.tag_extractor.outputs.latest_tag }} | |
generateReleaseNotes: true | |
tag: ${{ steps.tag_extractor.outputs.latest_tag }} | |
- name: Download DMG Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: gpt-computer-assistant-openai-dmg | |
path: dist_dmg | |
- name: Download EXE Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: gpt-computer-assistant-openai-exe | |
path: dist_exe | |
- name: List DMG Directory | |
run: ls -la dist_dmg | |
- name: List EXE Directory | |
run: ls -la dist_exe | |
- name: Upload DMG Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist_dmg/GPT_Computer_Assistant.dmg | |
asset_name: gpt-computer-assistant-openai.dmg | |
asset_content_type: application/octet-stream | |
- name: Upload EXE Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist_exe/GPT_Computer_Assistant.exe | |
asset_name: gpt-computer-assistant-openai.exe | |
asset_content_type: application/octet-stream |