Added more retries in get code event! #22
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: "Build & Release" | |
on: | |
pull_request: | |
branches: | |
- main | |
- master | |
push: | |
branches: | |
- main | |
- master | |
- develop | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: Build executable | |
run: | | |
pyinstaller --onefile main.py | |
- name: Rename executable | |
run: | | |
Rename-Item -Path dist/main.exe -NewName HamsterKeyGen-v1.0.${{ github.run_number }}.exe | |
shell: pwsh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: windows-build | |
path: dist/HamsterKeyGen-v1.0.${{ github.run_number }}.exe | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: Build executable | |
run: | | |
pyinstaller --onefile main.py | |
- name: Rename executable | |
run: | | |
mv dist/main dist/HamsterKeyGen-v1.0.${{ github.run_number }}.app | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: macos-build | |
path: dist/HamsterKeyGen-v1.0.${{ github.run_number }}.app | |
create-release: | |
needs: [build-windows, build-macos] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download Windows build | |
uses: actions/download-artifact@v2 | |
with: | |
name: windows-build | |
path: ./build | |
- name: Download macOS build | |
uses: actions/download-artifact@v2 | |
with: | |
name: macos-build | |
path: ./build | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ./build/* | |
tag: v1.0.${{ github.run_number }} | |
token: ${{ secrets.GH_TOKEN }} |