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
62 changes: 62 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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
on:
push:
branches: "**"
gurkanindibay marked this conversation as resolved.
Show resolved Hide resolved

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/xenial
hanefi marked this conversation as resolved.
Show resolved Hide resolved
- ubuntu/bionic
- ubuntu/focal

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

- name: Clone tools branch
run: git clone -b issue_156 --depth=1 https://github.com/citusdata/tools.git tools
hanefi marked this conversation as resolved.
Show resolved Hide resolved

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

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

- name: Build packages
run: |
python -m tools.packaging_automation.citus_package \
gurkanindibay marked this conversation as resolved.
Show resolved Hide resolved
--gh_token "${{ secrets.GH_TOKEN }}" \
--platform "${{ matrix.platform }}" \
--build_type 'release' \
hanefi marked this conversation as resolved.
Show resolved Hide resolved
--secret_key "${{ secrets.PACKAGING_SECRET_KEY }}" \
--passphrase "${{ secrets.PACKAGING_PASSPHRASE }}" \
--output_dir "$(pwd)/packages/" \
--input_files_dir "$(pwd)"

- name: Publish packages
run: |
python -m tools.packaging_automation.upload_to_package_cloud \
gurkanindibay marked this conversation as resolved.
Show resolved Hide resolved
--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}
hanefi marked this conversation as resolved.
Show resolved Hide resolved
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 install libcurl4-openssl-dev libssl-dev

- name: Clone tools branch
run: git clone -b issue-149 --depth=1 https://github.com/citusdata/tools.git tools
hanefi marked this conversation as resolved.
Show resolved Hide resolved

- 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)"
hanefi marked this conversation as resolved.
Show resolved Hide resolved