Resolve Existing Framework in Workflow #19
This file contains hidden or 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 Latest Build | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
branch-setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Remove Unnecessary Files | |
run: | | |
rm -f README.md | |
rm -rf .github | |
- name: Set up Git | |
run: | | |
# bot name from secrets | |
git config user.name "${{ secrets.BOT_NAME }}" | |
git config user.email "${{ secrets.BOT_EMAIL }}" | |
git checkout --orphan latest-release | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "Branch setup for latest release" | |
git push -f origin latest-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-mac: | |
runs-on: macos-latest | |
needs: [branch-setup] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: latest-release | |
- name: Install Dependencies | |
run: | | |
py313-mac/bin/python3 -m pip install -r requirements.txt | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: py313-mac | |
path: py313-mac/ | |
release: | |
runs-on: ubuntu-latest | |
needs: [branch-setup, build-mac] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: latest-release | |
- name: Remove Requirements File | |
run: | | |
rm -f requirements.txt | |
- name: Remove Original Framework | |
run: | | |
rm -rf py313-mac | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts | |
- name: Move Artifacts | |
run: | | |
mv artifacts/* . | |
rm -rf artifacts | |
- name: Version File | |
run: | | |
date +%s > version | |
- name: Set up Git | |
run: | | |
git config user.name "${{ secrets.BOT_NAME }}" | |
git config user.email "${{ secrets.BOT_EMAIL }}" | |
git checkout latest-release | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "Latest build $(date "+%Y-%m-%d %H:%M:%S")" | |
git push -f origin latest-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |