Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds update_package_properties and build_packages in pg-auto-failover-enterprise #713

Merged
merged 11 commits into from
Sep 1, 2021
66 changes: 66 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Package

env:
MAIN_BRANCH: "all-pgautofailover-enterprise"
PACKAGE_CLOUD_REPO_NAME: "sample"
PACKAGE_ENCRYPTION_KEY: ${{ secrets.PACKAGE_ENCRYPTION_KEY }}
hanefi marked this conversation as resolved.
Show resolved Hide resolved
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PACKAGE_CLOUD_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_TOKEN }}
PACKAGING_SECRET_KEY: ${{ secrets.PACKAGING_SECRET_KEY }}
PACKAGING_PASSPHRASE: ${{ secrets.PACKAGING_PASSPHRASE }}
on:
push:
branches:
- "**"

workflow_dispatch:

jobs:
build_package:
name: Build package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- el/7
- el/8
- ol/7
- debian/stretch
- debian/buster
- ubuntu/bionic
- ubuntu/focal

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Clone tools branch
run: git clone -b v0.8.1 --depth=1 https://github.com/citusdata/tools.git tools

- name: Install package dependencies
run: sudo apt-get update && sudo apt install libcurl4-openssl-dev libssl-dev

- name: Install python requirements
run: sudo apt-get update && python -m pip install -r tools/packaging_automation/requirements.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: sudo apt-get update && python -m pip install -r tools/packaging_automation/requirements.txt
run: python -m pip install -r tools/packaging_automation/requirements.txt

no need to do this again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


- name: Build packages
run: |
python -m tools.packaging_automation.citus_package \
--gh_token "${GH_TOKEN}" \
--platform "${{ matrix.platform }}" \
--build_type "release" \
--secret_key "${PACKAGING_SECRET_KEY}" \
--passphrase "${PACKAGING_PASSPHRASE}" \
--output_dir "$(pwd)/packages/" \
--input_files_dir "$(pwd)"

- name: Publish packages
run: |
python -m tools.packaging_automation.upload_to_package_cloud \
--platform "${{ matrix.platform }}" \
--package_cloud_api_token "${{ secrets.PACKAGE_CLOUD_API_TOKEN }}" \
--repository_name "${PACKAGE_CLOUD_REPO_NAME}" \
--output_file_path "$(pwd)/packages" \
--current_branch "${GITHUB_REF##*/}" \
--main_branch "${MAIN_BRANCH}"
52 changes: 52 additions & 0 deletions .github/workflows/update_package_properties.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update Package Properties

env:
PRJ_NAME: "pg_auto_failover_enterprise"
GH_TOKEN: ${{ secrets.GH_TOKEN }}
on:
workflow_dispatch:
inputs:
tag_name:
description: "The tag name on the project repo to be released"
fancy_version_no:
description: "If fancy versioning is needed, set value greater than 1 e.g 2"
default: "1"
microsoft_email:
description: "Email to be written on changelogs"
default: "[email protected]"
name:
description: "Name to be written on changelogs"
default: "Gurkan Indibay"
jobs:
update_package_properties:
name: Update package properties
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get update && apt install libcurl4-openssl-dev libssl-dev

- name: Clone tools branch
run: git clone -b v0.8.1 --depth=1 https://github.com/citusdata/tools.git tools

- name: Set git name and email
run: |
git config --global user.email "${{ github.event.inputs.microsoft_email }}" && \
git config --global user.name "${{ github.event.inputs.name }}"
hanefi marked this conversation as resolved.
Show resolved Hide resolved

- name: Install python requirements
run: python -m pip install -r tools/packaging_automation/requirements.txt

- name: Update package properties
run: |
python -m tools.packaging_automation.update_package_properties \
--gh_token="${GH_TOKEN}" \
--prj_name "${PRJ_NAME}" \
--tag_name "${{ github.event.inputs.tag_name }}" \
--email "${{ github.event.inputs.microsoft_email }}" \
--name "${{ github.event.inputs.name }}" \
--pipeline \
--exec_path "$(pwd)"