Skip to content

Commit

Permalink
[internal] Update GitHub Actions workflow files (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulumi-bot authored Dec 3, 2024
1 parent e11e27e commit 3cdb7a3
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
pattern: schema-embed.*
# Avoid creating directories for each artifact
merge-multiple: true
path: provider/cmd/pulumi-resource-xyz/schema-embed.json
path: provider/cmd/pulumi-resource-xyz
- name: Restore makefile progress
run: make --touch provider schema
- name: Build & package provider
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
version: ${{ needs.prerequisites.outputs.version }}
isPrerelease: true
skipGoSdk: true
skipJavaSdk: true

tag_release_if_labeled_needs_release:
name: Tag release if labeled as needs-release
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
default: false
type: boolean
description: Skip publishing & verifying the Go SDK
skipJavaSdk:
default: false
type: boolean
description: Skip publishing the Java SDK

env:
IS_PRERELEASE: ${{ inputs.isPrerelease }}
Expand Down Expand Up @@ -107,10 +111,17 @@ jobs:
with:
tools: pulumictl, pulumicli, dotnet, go, nodejs, python
- name: Publish SDKs
if: inputs.skipJavaSdk == false
uses: pulumi/pulumi-package-publisher@1c0359ba74243cf6651efacfd839c751d8ff87e2 # v0.0.20
with:
sdk: all,!java
version: ${{ inputs.version }}
- name: Publish SDKs (except Java)
if: inputs.skipJavaSdk == true
uses: pulumi/pulumi-package-publisher@1c0359ba74243cf6651efacfd839c751d8ff87e2 # v0.0.20
with:
sdk: all,!java,!java
version: ${{ inputs.version }}
- name: Download Go SDK
uses: ./.github/actions/download-sdk
with:
Expand Down
118 changes: 35 additions & 83 deletions .github/workflows/resync-build.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,41 @@
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt
name: "Resync Build Workflows"

on:
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST every Tuesday.
- cron: 0 3 * * TUE

permissions:
contents: write
pull-requests: write

env:
PULUMI_EXTRA_MAPPING_ERROR: true
PULUMI_MISSING_MAPPING_ERROR: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_API: https://api.pulumi-staging.io
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
PYPI_USERNAME: __token__
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
TF_APPEND_USER_AGENT: pulumi
GITHUB_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}

jobs:
resync_build:
name: resync-build
upgrade_provider:
name: pull-workflow-changes
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Persist credentials so we can push a new branch.
persist-credentials: true
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ci-mgmt
repository: pulumi/ci-mgmt
persist-credentials: false
- id: run-url
name: Create URL to the run output
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT"
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, go, nodejs, dotnet, python
- name: Sync with ci-mgmt
run: cp -r "ci-mgmt/provider-ci/providers/$PROVIDER/repo/." .
- name: Remove ci-mgmt directory
run: rm -rf ci-mgmt
- name: Required entries for gitignore
run: |-
cat <<- EOF > "$RUNNER_TEMP/gitignore"
sdk/java/build
sdk/java/.gradle
sdk/java/gradle
sdk/java/gradlew
sdk/java/gradlew.bat
EOF
shell: bash
- name: Adding missing lines to .gitignore
run: |
comm -23 <(sort "$RUNNER_TEMP/gitignore") <(sort .gitignore) >> .gitignore.temp
cat .gitignore.temp >> .gitignore
rm .gitignore.temp
shell: bash
- name: Build
run: make build
- name: Create PR (no linked issue)
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
author: pulumi-bot <[email protected]>
base: main
body: This pull request was generated automatically by the resync-build workflow
in this repository.
branch: pulumi-bot/resync-${{ github.run_id}}
commit-message: Resync build for pulumi-xyz
committer: pulumi-bot <[email protected]>
labels: impact/no-changelog-required
team-reviewers: platform-integrations
title: Fix up build for pulumi-xyz
token: ${{ secrets.PULUMI_BOT_TOKEN }}
name: Resync build
on:
workflow_dispatch:
inputs:
automerge:
default: false
description: Mark created PR for auto-merging?
required: true
type: boolean
- name: Checkout Repo
uses: actions/checkout@v4
with:
# Persist credentials so pull-workflow-changes can push a new branch.
persist-credentials: true
- name: Regenerate the workflow files via https://github.com/pulumi/ci-mgmt
run: |
make ci-mgmt
- name: Create PR (no linked issue)
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
author: pulumi-bot <[email protected]>
base: main
body: This pull request was generated automatically by the resync-build workflow
in this repository.
branch: chore/resync-${{ github.run_id }}
commit-message: Regenerate workflows for pulumi-xyz
committer: pulumi-bot <[email protected]>
labels: impact/no-changelog-required
title: Regenerate Github Actions workflows for pulumi-xyz
token: ${{ env.GITHUB_TOKEN }}

0 comments on commit 3cdb7a3

Please sign in to comment.