nightly-sdk-generation #677
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: 16.x | |
PYTHONVERSION: "3.7" | |
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@v3 | |
with: | |
lfs: true | |
- name: Unshallow clone for tags | |
run: git fetch --prune --unshallow --tags | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21.x | |
- name: Install pulumictl | |
uses: jaxxstorm/action-install-gh-release@v1.10.0 | |
with: | |
repo: pulumi/pulumictl | |
- name: Install Pulumi CLI | |
uses: pulumi/actions@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
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 ::set-output name=commit-hash::$(git rev-parse HEAD) | |
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 }}" | |
git push origin generate-sdk/${{ github.run_id }}-${{ github.run_number }} | |
- name: Create PR | |
id: create-pr | |
uses: repo-sync/pull-request@v2.6.2 | |
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@v3 | |
with: | |
author_name: Failure during automated SDK generation | |
fields: repo,commit,author,action | |
status: ${{ job.status }} |