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

IHRACP-7598: CI/CD for Pypodcastparser - publish-release-version #26

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/push-released-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: publish-release-version

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::219619990026:role/content-github-actions-role
aws-region: us-east-1
role-duration-seconds: 1200

- name: Setting up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Installing Dependencies
run: |
pip install pip --upgrade
pip install virtualenv

- name: Deploy to CodeArtifact
run: |
export TWINE_USERNAME=aws
export TWINE_PASSWORD=$(aws codeartifact get-authorization-token --domain content-platform --domain-owner 219619990026 --region us-east-1 --query authorizationToken --output text)
export TWINE_REPOSITORY_URL=$(aws codeartifact get-repository-endpoint --domain content-platform --domain-owner 219619990026 --repository content-platform --region us-east-1 --format pypi --query repositoryEndpoint --output text)
export BRANCH_NAME=$(echo $GITHUB_REF | sed 's/refs\/heads\///')
CURRENT_VERSION=$(git describe --abbrev=0 --tags)
echo "Current released version is: $CURRENT_VERSION"
pip install -r requirements-ci.txt
VERSION=$CURRENT_VERSION python setup.py sdist bdist_wheel
twine upload --verbose --repository pypodcastparser-ihr dist/*
Loading