remove commented line (#23) #28
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: Build and Release | |
# will create linux and macos distributables and a release for them | |
# when a new tag is pushed. | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
- name: Build with pyinstaller | |
run: pyinstaller --onefile -n cg-manage-rds cli.py | |
- name: zip | |
working-directory: dist | |
run: zip cg-manage-rds.ubuntu-latest.x64.zip cg-manage-rds | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: linux | |
path: dist/cg-manage-rds.ubuntu-latest.x64.zip | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
- name: Build with pyinstaller | |
run: pyinstaller --onefile -n cg-manage-rds cli.py | |
- name: zip | |
working-directory: dist | |
run: zip cg-manage-rds.macos-latest.x64.zip cg-manage-rds | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: macos | |
path: dist/cg-manage-rds.macos-latest.x64.zip | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
- name: Build with pyinstaller | |
run: pyinstaller --onefile -n cg-manage-rds cli.py | |
- name: zip | |
working-directory: dist | |
run: 7z a -tzip cg-manage-rds.windows-latest.x64.zip cg-manage-rds.exe | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: windows | |
path: dist/cg-manage-rds.windows-latest.x64.zip | |
release: | |
needs: | |
- build-linux | |
- build-mac | |
- build-windows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Make Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/linux/cg-manage-rds.ubuntu-latest.x64.zip | |
dist/macos/cg-manage-rds.macos-latest.x64.zip | |
dist/windows/cg-manage-rds.windows-latest.x64.zip | |
update-formula: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: get release info | |
id: release_data | |
uses: KevinRohn/[email protected] | |
- name: get tar.gz | |
run: | | |
wget -O source.tar.gz ${{ steps.release_data.outputs.tarball_url }} | |
echo "# Generated by github bot in cloud-gov/cg-manage-rds" > cg-manage-rds.env | |
echo "HOMEPAGE='https://github.com/cloud-gov/cg-manage-rds'" >> cg-manage-rds.env | |
echo "URL='${{ steps.release_data.outputs.tarball_url }}'" >> cg-manage-rds.env | |
echo "VERSION='${{ steps.release_data.outputs.tag_name }}'" >> cg-manage-rds.env | |
echo "SHA=$(shasum -a 256 ./source.tar.gz | awk '{print $1}')" >> cg-manage-rds.env | |
cat cg-manage-rds.env | |
- name: get hombrew repo | |
uses: actions/checkout@v3 | |
with: | |
repository: cloud-gov/homebrew-cloudgov | |
path: homebrew | |
token: ${{secrets.CGCIBOT_PAT}} | |
persist-credentials: false | |
- name: Import bot's GPG key for signing commits | |
id: import-gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
gpg_private_key: ${{ secrets.CGCIBOT_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.CGCIBOT_GPG_PASSPHRASE }} | |
git_config_global: true | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: update versions | |
run: mv cg-manage-rds.env homebrew/Versions/cg-manage-rds/cg-manage-rds.env | |
- name: Generate Formula | |
working-directory: homebrew/Versions | |
run: | | |
pwd | |
./gen_formula.sh | |
- name: GitHub Commit & Push | |
uses: actions-js/[email protected] | |
with: | |
repository: cloud-gov/homebrew-cloudgov | |
directory: homebrew | |
github_token: ${{secrets.CGCIBOT_PAT}} | |
author_name: ${{ steps.import-gpg.outputs.name }} | |
author_email: ${{ steps.import-gpg.outputs.email }} | |
empty: true |