diff --git a/.github/actions/check-worktree-clean/action.yml b/.github/actions/check-worktree-clean/action.yml deleted file mode 100644 index 2dd2f6f5cc6e..000000000000 --- a/.github/actions/check-worktree-clean/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Check worktree clean -description: Fail if there's uncommitted changes in git worktree. - -runs: - using: "composite" - steps: - - run: git status - shell: bash - - - name: Check git status - id: git-status - shell: bash - run: echo "STATUS=$(git status -s)" >> $GITHUB_OUTPUT - - - name: Fail if work-tree not clean - if: steps.git-status.STATUS != '' - shell: bash - run: | - echo "${{ steps.git-status.STATUS }}" - git diff | head -20 - exit 1 diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index f69acc9b8baf..60dbe8607140 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -42,7 +42,7 @@ jobs: version: if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - uses: ./.github/workflows/dev-version.yml + uses: ./.github/workflows/version.yml secrets: inherit build_test: diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e03fbebe119f..acaf36b1ffc6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -71,7 +71,7 @@ jobs: compare_to: ${{ github.base_ref }} - name: Check worktree clean - uses: ./.github/actions/check-worktree-clean + uses: pulumi/git-status-check-action@v1 - if: failure() && github.event_name == 'push' name: Notify Slack @@ -122,7 +122,7 @@ jobs: run: make build_${{ matrix.language }} - name: Check worktree clean - uses: ./.github/actions/check-worktree-clean + uses: pulumi/git-status-check-action@v1 - name: Tar SDK folder if: ${{ matrix.language != 'go' }} @@ -250,7 +250,7 @@ jobs: go mod edit -replace github.com/pulumi/examples/misc/test=../p-examples/misc/test/ && \ go mod tidy && \ go test -v -json -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 16 . 2>&1 | tee /tmp/gotest.log | gotestfmt - + test_provider: runs-on: ubuntu-latest name: Test Provider diff --git a/.github/workflows/dev-version.yml b/.github/workflows/dev-version.yml deleted file mode 100644 index b0c60dab8a29..000000000000 --- a/.github/workflows/dev-version.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: dev-version - -on: - workflow_call: - outputs: - version: - description: Calculated version - value: ${{ jobs.version.outputs.version }} - -env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - -jobs: - version: - runs-on: ubuntu-latest - name: Calculate Dev Version - steps: - - id: version - name: Calculate build version - # We aim to have sequential release versions - this version should be sorted after the last release and before the next release. - run: | - GH_VERSION=$(gh release list --repo pulumi/pulumi-azure-native --exclude-drafts --exclude-pre-releases --limit 1) - # Get latest stable release. Return only first column from result (tag). - LAST_VERSION=$(echo "${GH_VERSION}" | cut -f1) - # Use semver NPM CLI tool to find next minimal version - NEXT_VERSION=$(npx -y semver --increment patch "${LAST_VERSION}") - # Include an always-increasing number to order correctly - TIMESTAMP=$(date +%s) - # Indicate the commit the build came from - SHORTHASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - # Combine all version components together - VERSION=${NEXT_VERSION}-alpha.${TIMESTAMP}+${SHORTHASH} - echo "${VERSION}" - echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" - outputs: - version: ${{ steps.version.outputs.VERSION }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 9655f09b85cf..5e7a0d0d7a8a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -21,7 +21,7 @@ on: jobs: version: - uses: ./.github/workflows/dev-version.yml + uses: ./.github/workflows/version.yml secrets: inherit build_test: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f351befd3e79..f655e3427330 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,14 +7,8 @@ on: jobs: version: - runs-on: ubuntu-latest - steps: - - id: version - name: Calculate build version - # Remove "v" if present - run: echo "version=${GITHUB_REF_NAME/v/}" >> "$GITHUB_OUTPUT" - outputs: - version: ${{ steps.version.outputs.version }} + uses: ./.github/workflows/version.yml + secrets: inherit build_test: uses: ./.github/workflows/build-test.yml diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 000000000000..6d1e9710470d --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,22 @@ +name: dev-version + +on: + workflow_call: + outputs: + version: + description: Calculated version + value: ${{ jobs.version.outputs.version }} + +env: + GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} + +jobs: + version: + runs-on: ubuntu-latest + name: Calculate Dev Version + steps: + - id: version + name: Calculate build version + uses: pulumi/provider-version-action@v1 + outputs: + version: ${{ steps.version.outputs.VERSION }}