Skip to content

Commit

Permalink
Fix git push for Go SDK publish
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrbradley committed Sep 7, 2022
1 parent 6ee9442 commit 2a799b9
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 45 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/build.yml
Expand Up @@ -509,20 +509,6 @@ jobs:
- name: Uncompress java SDK
run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C
${{github.workspace}}/sdk/java
- name: Checkout Go SDK repo
uses: actions/checkout@v2
with:
repository: pulumi/pulumi-azure-native-sdk
path: sdk/pulumi-azure-native-sdk
- name: Download Go split SDK
uses: actions/download-artifact@v2
with:
name: pulumi-azure-native-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: UnTar Go split SDK folder
run: |
mkdir -p ${{github.workspace}}/sdk/pulumi-azure-native-sdk
tar -zxf ${{ github.workspace}}/sdk/pulumi-azure-native-sdk.tar.gz -C ${{github.workspace}}/sdk/pulumi-azure-native-sdk
- name: Install Twine
run: python -m pip install pip twine
- name: Publish SDKs
Expand All @@ -538,17 +524,39 @@ jobs:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
build-root-directory: ./sdk/java
gradle-version: 7.4.1
- name: Checkout Go SDK repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
repository: pulumi/pulumi-azure-native-sdk
path: sdk/pulumi-azure-native-sdk
fetch-depth: 0
- name: Prepare Go SDK repo
run: |
cd sdk/pulumi-azure-native-sdk
find . -maxdepth 1 -not -name '.*' -exec rm -rf {} \;
- name: Download Go split SDK
uses: actions/download-artifact@v2
with:
name: pulumi-azure-native-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: UnTar Go split SDK folder
run: |
mkdir -p ${{github.workspace}}/sdk/pulumi-azure-native-sdk
tar -zxf ${{ github.workspace}}/sdk/pulumi-azure-native-sdk.tar.gz -C ${{github.workspace}}/sdk/pulumi-azure-native-sdk
- name: Publish Split Go SDK
run: |
VERSION="v$(pulumictl get version --language generic)"
make prepublish_go
cd sdk/pulumi-azure-native-sdk
git config user.name "Pulumi Bot"
git config user.email "bot@pulumi.com"
git add .
git commit -m "$VERSION"
git tag "$VERSION"
# Find go.mod's, get parent dir name, concat with version, set as a tag
find */go.mod -type f -exec sh -c "dirname {} | xargs basename | xargs printf "%s/$VERSION" | xargs git tag" \;
git push origin --tags
git push --tags
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
39 changes: 24 additions & 15 deletions .github/workflows/prerelease.yml
Expand Up @@ -500,20 +500,6 @@ jobs:
- name: Uncompress java SDK
run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C
${{github.workspace}}/sdk/java
- name: Checkout Go SDK repo
uses: actions/checkout@v2
with:
repository: pulumi/pulumi-azure-native-sdk
path: sdk/pulumi-azure-native-sdk
- name: Download Go split SDK
uses: actions/download-artifact@v2
with:
name: pulumi-azure-native-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: UnTar Go split SDK folder
run: |
mkdir -p ${{github.workspace}}/sdk/pulumi-azure-native-sdk
tar -zxf ${{ github.workspace}}/sdk/pulumi-azure-native-sdk.tar.gz -C ${{github.workspace}}/sdk/pulumi-azure-native-sdk
- name: Install Twine
run: python -m pip install pip twine
- name: Publish SDKs
Expand All @@ -529,17 +515,40 @@ jobs:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
build-root-directory: ./sdk/java
gradle-version: 7.4.1
- name: Checkout Go SDK repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
repository: pulumi/pulumi-azure-native-sdk
path: sdk/pulumi-azure-native-sdk
fetch-depth: 0
- name: Prepare Go SDK repo
run: |
cd sdk/pulumi-azure-native-sdk
git checkout master
find . -maxdepth 1 -not -name '.*' -exec rm -rf {} \;
- name: Download Go split SDK
uses: actions/download-artifact@v2
with:
name: pulumi-azure-native-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: UnTar Go split SDK folder
run: |
mkdir -p ${{github.workspace}}/sdk/pulumi-azure-native-sdk
tar -zxf ${{ github.workspace}}/sdk/pulumi-azure-native-sdk.tar.gz -C ${{github.workspace}}/sdk/pulumi-azure-native-sdk
- name: Publish Split Go SDK
run: |
VERSION="v$(pulumictl get version --language generic)"
make prepublish_go
cd sdk/pulumi-azure-native-sdk
git config user.name "Pulumi Bot"
git config user.email "bot@pulumi.com"
git add .
git commit -m "$VERSION"
git tag "$VERSION"
# Find go.mod's, get parent dir name, concat with version, set as a tag
find */go.mod -type f -exec sh -c "dirname {} | xargs basename | xargs printf "%s/$VERSION" | xargs git tag" \;
git push origin --tags
git push --tags
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
39 changes: 24 additions & 15 deletions .github/workflows/release.yml
Expand Up @@ -507,20 +507,6 @@ jobs:
- name: Uncompress java SDK
run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C
${{github.workspace}}/sdk/java
- name: Checkout Go SDK repo
uses: actions/checkout@v2
with:
repository: pulumi/pulumi-azure-native-sdk
path: sdk/pulumi-azure-native-sdk
- name: Download Go split SDK
uses: actions/download-artifact@v2
with:
name: pulumi-azure-native-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: UnTar Go split SDK folder
run: |
mkdir -p ${{github.workspace}}/sdk/pulumi-azure-native-sdk
tar -zxf ${{ github.workspace}}/sdk/pulumi-azure-native-sdk.tar.gz -C ${{github.workspace}}/sdk/pulumi-azure-native-sdk
- name: Install Twine
run: python -m pip install pip twine
- name: Publish SDKs
Expand All @@ -536,17 +522,40 @@ jobs:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
build-root-directory: ./sdk/java
gradle-version: 7.4.1
- name: Checkout Go SDK repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
repository: pulumi/pulumi-azure-native-sdk
path: sdk/pulumi-azure-native-sdk
fetch-depth: 0
- name: Prepare Go SDK repo
run: |
cd sdk/pulumi-azure-native-sdk
git checkout master
find . -maxdepth 1 -not -name '.*' -exec rm -rf {} \;
- name: Download Go split SDK
uses: actions/download-artifact@v2
with:
name: pulumi-azure-native-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: UnTar Go split SDK folder
run: |
mkdir -p ${{github.workspace}}/sdk/pulumi-azure-native-sdk
tar -zxf ${{ github.workspace}}/sdk/pulumi-azure-native-sdk.tar.gz -C ${{github.workspace}}/sdk/pulumi-azure-native-sdk
- name: Publish Split Go SDK
run: |
VERSION="v$(pulumictl get version --language generic)"
make prepublish_go
cd sdk/pulumi-azure-native-sdk
git config user.name "Pulumi Bot"
git config user.email "bot@pulumi.com"
git add .
git commit -m "$VERSION"
git tag "$VERSION"
# Find go.mod's, get parent dir name, concat with version, set as a tag
find */go.mod -type f -exec sh -c "dirname {} | xargs basename | xargs printf "%s/$VERSION" | xargs git tag" \;
git push origin --tags
git push --tags
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down

0 comments on commit 2a799b9

Please sign in to comment.