Skip to content

publish

publish #73

Workflow file for this run

name: publish
on:
workflow_dispatch:
inputs:
identifier:
description: identifier
required: true
permissions:
id-token: write
contents: read
actions: write
jobs:
start_deploy:
runs-on: ubuntu-24.04
name: start_deploy (${{ github.event.inputs.identifier }})
steps:
- name: Add Mask
run: |
echo "::add-mask::${{ secrets.ACCOUNT_ID }}"
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: publish=${{ github.event.inputs.identifier }}
path: build_config.json
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ARN_ROLE_PUBLISHER }}
aws-region: ${{ vars.BASE_AWS_REGION }}
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
- run: |
pip install "poetry<3.0"
poetry install --only main
- run: make publish-start-publish
env:
IDENTIFIER: ${{ github.event.inputs.identifier }}
TABLE_NAME: ${{ vars.TABLE_NAME }}
URL_ACTION_RUN: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: actions/upload-artifact@v4
with:
name: publish-layer-json
path: layer.json
build:
runs-on: ${{ matrix.runner }}
needs:
- start_deploy
strategy:
fail-fast: true
matrix:
max_concurrency: [2]
index: [0, 1]
runner:
- ubuntu-24.04
- ubuntu-24.04-arm
steps:
- name: Add Mask
run: |
echo "::add-mask::${{ secrets.ACCOUNT_ID }}"
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
- run: |
pip install "poetry<3.0"
poetry install --only main
mkdir -p dist/modules
touch "dist/modules/keep-${RUNNER_NAME}-${MAX_CONCURRENCY}-${CONCURRENCY_INDEX}"
env:
RUNNER_NAME: ${{ matrix.runner }}
MAX_CONCURRENCY: ${{ matrix.max_concurrency }}
CONCURRENCY_INDEX: ${{ matrix.index }}
- name: tmp
run: |
echo $ACTIONS_URL
echo "identifier: ${{ github.event.inputs.identifier }}"
echo "max_concurrency: ${{ matrix.max_concurrency }}"
echo "index: ${{ matrix.index }}"
echo "runner: ${{ matrix.runner }}"
env:
ACTIONS_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: actions/download-artifact@v4
with:
name: publish-layer-json
- run: make publish-build
env:
MY_RUNNER_NAME: ${{ matrix.runner }}
MAX_CONCURRENCY: ${{ matrix.max_concurrency }}
CONCURRENCY_INDEX: ${{ matrix.index }}
- run: sh install_script.sh
- run: find dist/ -type f | sort
- uses: actions/upload-artifact@v4
with:
path: dist/
name: modules-${{ matrix.runner }}-${{ matrix.max_concurrency }}-${{ matrix.index }}
publish:
runs-on: ubuntu-24.04
needs:
- build
strategy:
fail-fast: true
matrix:
region:
- af-south-1
- ap-south-2
- ap-southeast-3
- ap-southeast-4
- ap-southeast-5
- ap-southeast-7
- ca-west-1
- eu-central-2
- eu-south-1
- eu-south-2
- il-central-1
- me-central-1
- me-south-1
- mx-central-1
- ap-northeast-1
- ap-northeast-2
- ap-northeast-3
- ap-south-1
- ap-southeast-1
- ap-southeast-2
- ca-central-1
- eu-central-1
- eu-north-1
- eu-west-1
- eu-west-2
- eu-west-3
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
concurrency:
cancel-in-progress: false
group: publish-in-${{ matrix.region }}
steps:
- name: Add Mask
run: |
echo "::add-mask::${{ secrets.ACCOUNT_ID }}"
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ARN_ROLE_PUBLISHER }}
aws-region: ${{ matrix.region }}
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
- run: |
pip install "poetry<3.0"
poetry install --only main
- name: tmp
run: |
echo $ACTIONS_URL
echo "identifier: ${{ github.event.inputs.identifier }}"
echo "region: ${{ matrix.region }}"
env:
ACTIONS_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: actions/download-artifact@v4
with:
name: publish-layer-json
- uses: actions/download-artifact@v4
with:
pattern: modules-*
merge-multiple: true
- run: find modules/ -type f | sort
- run: make publish-publish-before-publish
- run: aws s3 sync src/ s3://artifact-bucket-${{ secrets.ACCOUNT_ID }}-${{ env.AWS_REGION }}
- run: make publish-publish-after-publish
finish_deploy:
runs-on: ubuntu-24.04
needs:
- publish
steps:
- name: Add Mask
run: |
echo "::add-mask::${{ secrets.ACCOUNT_ID }}"
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ARN_ROLE_PUBLISHER }}
aws-region: ${{ vars.BASE_AWS_REGION }}
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
- run: |
pip install "poetry<3.0"
poetry install --only main
- run: make publish-finish-publish
env:
IDENTIFIER: ${{ github.event.inputs.identifier }}
TABLE_NAME: ${{ vars.TABLE_NAME }}
call_generate:
needs:
- finish_deploy
uses: ./.github/workflows/generate.yml
secrets: inherit
with:
identifier: ${{ github.event.inputs.identifier }}
notify-failed:
runs-on: ubuntu-24.04
if: failure()
needs:
- start_deploy
- publish
- finish_deploy
steps:
- name: Add Mask
run: |
echo "::add-mask::${{ secrets.ACCOUNT_ID }}"
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ARN_ROLE_PUBLISHER }}
aws-region: ${{ vars.BASE_AWS_REGION }}
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
- run: |
pip install "poetry<3.0"
poetry install --only main
- run: make update-failed
env:
IDENTIFIER: ${{ github.event.inputs.identifier }}
TABLE_NAME: ${{ vars.TABLE_NAME }}
URL_ACTION_RUN: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
EVENT_BUS_NAME: ${{ vars.EVENT_BUS_NAME }}