Skip to content

ci: remove version when syncing file #137

ci: remove version when syncing file

ci: remove version when syncing file #137

Workflow file for this run

name: Sync package
on:
push:
branches: [ "main", "ci/remove-sync-version" ]
env:
AWS_REGION : "us-west-2"
# permission can be added at job level or workflow level
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
on-success:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: |
python -m pip install --upgrade hatch==1.15.0
- name: Build distribution
run: hatch build
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
with:
role-to-assume: "${{ secrets.ACTIONS_SYNC_ROLE_NAME }}"
role-session-name: gh-python
aws-region: ${{ env.AWS_REGION }}
- name: Copy tar gz build file to s3
run: |
aws s3 cp ./dist/*.tar.gz \
s3://${{ secrets.S3_BUCKET_NAME }}/aws-durable-execution-sdk-python.tar.gz
- name: commit tar gz to Gitfarm
run: |
aws lambda invoke \
--function-name ${{ secrets.SYNC_LAMBDA_ARN }} \
--payload '{"gitFarmRepo":"${{ secrets.GITFARM_LAN_SDK_REPO }}","gitFarmBranch":"${{ secrets.GITFARM_LAN_SDK_BRANCH }}","gitFarmFilepath":"aws-durable-execution-sdk-python.tar.gz","s3Bucket":"${{ secrets.S3_BUCKET_NAME }}","s3FilePath":"aws-durable-execution-sdk-python.tar.gz", "gitHubRepo": "aws-durable-execution-sdk-python", "gitHubCommit":"${{ github.sha }}"}' \
--cli-binary-format raw-in-base64-out \
output.txt
- name: Check for error in lambda invoke
run: |
if grep -q "Error" output.txt; then
cat output.txt
exit 1
fi
- name: Copy whl build file to s3
run: |
aws s3 cp ./dist/*.whl \
s3://${{ secrets.S3_BUCKET_NAME }}/aws-durable-execution-sdk-python.whl
- name: commit whl to Gitfarm
run: |
aws lambda invoke \
--function-name ${{ secrets.SYNC_LAMBDA_ARN }} \
--payload '{"gitFarmRepo":"${{ secrets.GITFARM_LAN_SDK_REPO }}","gitFarmBranch":"${{ secrets.GITFARM_LAN_SDK_BRANCH }}","gitFarmFilepath":"aws-durable-execution-sdk-python.whl","s3Bucket":"${{ secrets.S3_BUCKET_NAME }}","s3FilePath":"aws-durable-execution-sdk-python.whl", "gitHubRepo": "aws-durable-execution-sdk-python", "gitHubCommit":"${{ github.sha }}"}' \
--cli-binary-format raw-in-base64-out \
output.txt
- name: Check for error in lambda invoke
run: |
if grep -q "Error" output.txt; then
cat output.txt
exit 1
fi