nightly-sdk-generation #926
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt | |
name: nightly-sdk-generation | |
on: | |
schedule: | |
- cron: 35 4 * * 1-5 | |
workflow_dispatch: {} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | |
PROVIDER: aws-native | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} | |
PYPI_USERNAME: __token__ | |
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
TRAVIS_OS_NAME: linux | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. | |
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} | |
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} | |
GOVERSION: 1.21.x | |
NODEVERSION: 20.x | |
PYTHONVERSION: "3.11" | |
DOTNETVERSION: | | |
6.0.x | |
3.1.301 | |
JAVAVERSION: "11" | |
AWS_REGION: us-west-2 | |
PULUMI_API: https://api.pulumi-staging.io | |
jobs: | |
generate-sdk: | |
runs-on: ubuntu-latest | |
name: generate-sdk | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
lfs: true | |
- name: Install Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version: 1.21.x | |
cache-dependency-path: "**/*.sum" | |
- name: Install pulumictl | |
uses: jaxxstorm/action-install-gh-release@71d17cb091aa850acb2a1a4cf87258d183eb941b # v1.11.0 | |
with: | |
repo: pulumi/pulumictl | |
- name: Install Pulumi CLI | |
uses: pulumi/actions@c7fad9e2f0b79653172b36538b8b34b3c0291952 # v6.0.0 | |
with: | |
pulumi-version-file: .pulumi.version | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-region: ${{ env.AWS_REGION }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
role-duration-seconds: 3600 | |
role-session-name: ${{ env.PROVIDER }}@githubActions | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | |
- name: Cleanup SDK Folder | |
run: make clean | |
- name: Preparing Git Branch | |
run: > | |
git config --local user.email "bot@pulumi.com" | |
git config --local user.name "pulumi-bot" | |
git checkout -b generate-sdk/${{ github.run_id }}-${{ github.run_number }} | |
- name: Commit Empty SDK | |
run: |- | |
git add . | |
git commit -m "Preparing the SDK folder for regeneration" | |
- name: Discovery | |
run: make discovery | |
- name: Build codegen binaries | |
run: make codegen | |
- name: Build Schema + SDKs | |
run: make local_generate | |
- name: Git submodule commit hash | |
id: vars | |
run: echo commit-hash=$(git rev-parse HEAD) >> "$GITHUB_OUTPUT" | |
working-directory: aws-cloudformation-user-guide | |
- name: Commit changes | |
run: >- | |
git add sdk | |
git commit -m "Regenerating SDKs based on aws-cloudformation-user-guide @ ${{ steps.vars.outputs.commit-hash }}" || echo "ignore commit failure, may be empty" | |
git add . | |
git commit -m "Regenerating based on aws-cloudformation-user-guide @ ${{ steps.vars.outputs.commit-hash }}" || echo "ignore commit failure, may be empty" | |
git push origin generate-sdk/${{ github.run_id }}-${{ github.run_number }} | |
- name: Create PR | |
id: create-pr | |
uses: repo-sync/pull-request@7e79a9f5dc3ad0ce53138f01df2fad14a04831c5 # v2.12.1 | |
with: | |
destination_branch: master | |
github_token: ${{ secrets.PULUMI_BOT_TOKEN }} | |
pr_body: "*Automated PR*" | |
pr_title: Automated SDK generation @ aws-cloudformation-user-guide ${{ | |
steps.vars.outputs.commit-hash }} | |
author_name: pulumi-bot | |
source_branch: generate-sdk/${{ github.run_id }}-${{ github.run_number }} | |
- if: failure() && github.event_name == 'push' | |
name: Notify Slack | |
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 | |
with: | |
author_name: Failure during automated SDK generation | |
fields: repo,commit,author,action | |
status: ${{ job.status }} |