Bump to 2.0.0beta #38
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
on: | |
push: | |
tags: | |
- "v*" | |
name: Release Multi Platform | |
jobs: | |
create-release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
outputs: | |
is_beta: ${{ steps.release_type.outputs.is_beta }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Determine Release Type | |
id: release_type | |
run: | | |
if [[ "${GITHUB_REF##*/}" == *beta* ]]; then | |
echo "is_beta=true" >> $GITHUB_OUTPUT | |
else | |
echo "is_beta=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/[email protected] | |
with: | |
tag: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
bodyFile: release_text.md | |
draft: ${{ steps.release_type.outputs.is_beta }} | |
prerelease: ${{ steps.release_type.outputs.is_beta }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-linux: | |
name: Build Ubuntu | |
needs: create-release | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install fpm | |
run: | | |
sudo apt-get install ruby ruby-dev rubygems build-essential | |
sudo gem install --no-document --minimal-deps fpm | |
fpm --version | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
cache-dependency-path: "requirements/base.txt" | |
- name: Install Python dependencies | |
run: pip install -r requirements/base.txt | |
- name: Run ppg | |
run: | | |
ppg freeze | |
ppg installer | |
- name: Upload to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ needs.create-release.outputs.is_beta == 'true' && 'target/PyES Beta.deb' || 'target/PyES.deb' }} | |
asset_name: ${{ needs.create-release.outputs.is_beta == 'true' && 'PyES Beta-${{ github.ref_name }}.deb' || 'PyES-${{ github.ref_name }}.deb' }} | |
tag: ${{ github.ref_name }} | |
overwrite: true | |
build-macos: | |
name: Build macOS | |
needs: create-release | |
runs-on: macos-12 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
cache-dependency-path: "requirements/base.txt" | |
- name: Install Python dependencies | |
run: pip install -r requirements/base.txt | |
- name: Run ppg | |
run: | | |
ppg freeze | |
ppg installer | |
- name: Upload to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ needs.create-release.outputs.is_beta == 'true' && 'target/PyES Beta.dmg' || 'target/PyES.dmg' }} | |
asset_name: ${{ needs.create-release.outputs.is_beta == 'true' && 'PyES Beta-${{ github.ref_name }}.dmg' || 'PyES-${{ github.ref_name }}.dmg' }} | |
tag: ${{ github.ref_name }} | |
overwrite: true | |
build-windows: | |
name: Build Windows | |
needs: create-release | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
cache-dependency-path: "requirements/base.txt" | |
- name: Install Python dependencies | |
run: pip install -r requirements/base.txt | |
- name: Run ppg | |
run: | | |
ppg freeze | |
ppg installer | |
- name: Upload to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ needs.create-release.outputs.is_beta == 'true' && 'target/PyES BetaSetup.exe' || 'target/PyESSetup.exe' }} | |
asset_name: ${{ needs.create-release.outputs.is_beta == 'true' && 'PyES Beta-${{ github.ref_name }}.exe' || 'PyES-${{ github.ref_name }}.exe' }} | |
tag: ${{ github.ref_name }} | |
overwrite: true | |
rollback-release: | |
name: Rollback | |
if: ${{ failure() }} | |
needs: [build-linux, build-macos, build-windows] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Rollback | |
uses: author/[email protected] | |
with: | |
tag: ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |