From c0b30811818fdb8f3353c041ad9d6fdf2d8cafe6 Mon Sep 17 00:00:00 2001 From: Harold Hunt Date: Fri, 20 May 2022 10:34:06 -0400 Subject: [PATCH] issue/239 - Fix broken publishing (#241) * issue/239 - Fix broken publishing Fixes #239 * workflow updates * Remove version-txt ref in main build --- .github/workflows/main-build.yml | 264 ++++++++++++++-------- .github/workflows/release.yml | 372 +++++++++++++++---------------- 2 files changed, 346 insertions(+), 290 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index ffbe7130..2b31feea 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -13,127 +13,121 @@ on: - main jobs: - # - # CDK Construct - # - build-cdk-construct: + build: name: Build CDK Construct runs-on: ubuntu-latest permissions: - contents: read - packages: read + contents: write + outputs: + self_mutation_happened: ${{ steps.self_mutation.outputs.self_mutation_happened }} env: CI: "true" steps: - name: Checkout uses: actions/checkout@v2 with: - fetch-depth: 0 - - - name: Set git identity - run: |- - git config user.name "Automation" - git config user.email "github-actions@github.com" - - # - name: Fix Permissions - # run: | - # chown -R root ./ - # chmod -R 777 ./ - - - name: Use Node.js 16 - uses: actions/setup-node@v2 + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Setup Node.js + uses: actions/setup-node@v2.2.0 with: node-version: 16 cache: 'yarn' cache-dependency-path: '**/yarn.lock' - - name: Install dependencies run: yarn install --frozen-lockfile - - # - name: Generate Projen Files - # working-directory: packages/microapps-cdk/ - # run: | - # yarn projen - - name: Build All TypeScript run: yarn build - - name: Run Node Tests env: NODE_ENV: test run: yarn test - - # - name: Move root NPM modules out of the way - # run: mv node_modules node_modules_hide - - name: Install CDK Construct Deps working-directory: packages/microapps-cdk/ - run: yarn install - - # - name: Post Install Patch of api-gatewayv2 - # working-directory: packages/microapps-cdk/ - # run: npx patch-package - + run: yarn install --frozen-lockfile - name: Build CDK Construct working-directory: packages/microapps-cdk/ - run: | - yarn build - - - name: Check for new commits - id: git_remote - run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ - github.ref }} | cut -f1)" - - - name: Upload CDK Construct Artifact - # if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} + run: yarn build + - name: Projen build + working-directory: packages/microapps-cdk/ + run: npx projen build + - id: self_mutation + name: Find mutations + run: |- + git add . + git diff --staged --patch --exit-code > .repo.patch || echo "::set-output name=self_mutation_happened::true" + - if: steps.self_mutation.outputs.self_mutation_happened + name: Upload patch uses: actions/upload-artifact@v2 with: - name: cdk-construct-dist + name: .repo.patch + path: .repo.patch + - name: Fail build on mutation + if: steps.self_mutation.outputs.self_mutation_happened + run: |- + echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch." + cat .repo.patch + exit 1 + - name: Upload CDK Construct artifact + uses: actions/upload-artifact@v2.1.1 + with: + name: build-artifact path: packages/microapps-cdk/dist - container: - # https://hub.docker.com/r/jsii/superchain - image: jsii/superchain:1-buster-slim-node16 - + self-mutation: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository) + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + token: ${{ secrets.PROJEN_GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Download patch + uses: actions/download-artifact@v2 + with: + name: .repo.patch + path: ${{ runner.temp }} + - name: Apply patch + run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" + - name: Push changes + run: |2- + git add . + git commit -s -m "chore: self mutation" + git push origin HEAD:${{ github.event.pull_request.head.ref }} # # Publish Tool # build-publish-tool: + needs: build name: Build Publish Tool runs-on: ubuntu-latest - steps: - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Use Node.js 16 uses: actions/setup-node@v2 with: node-version: 16 cache: 'yarn' cache-dependency-path: '**/yarn.lock' - - name: Check for new commits id: git_remote - run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ - github.ref }} | cut -f1)" - + run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" - name: Install Node Modules run: yarn install --frozen-lockfile - - # - name: Generate Projen Files - # working-directory: packages/microapps-cdk/ - # run: | - # yarn projen - - name: Build Publish TypeScript run: yarn build:publish - - name: Run Lint run: yarn lint - - name: Upload Publish Tool artifact uses: actions/upload-artifact@v2 with: @@ -141,7 +135,6 @@ jobs: path: | packages/microapps-publish/ !packages/microapps-publish/node_modules/ - - name: Upload Datalib artifact uses: actions/upload-artifact@v2 with: @@ -149,53 +142,134 @@ jobs: path: | packages/microapps-datalib/ !packages/microapps-datalib/node_modules/ - # # Release Assets - Dry Run Only # - release-assets: - # Release only on main branch - name: Release Assets - Dry Run - needs: [ build-cdk-construct, build-publish-tool ] + package-js-publish-tool: + needs: [ build, build-publish-tool ] runs-on: ubuntu-latest - permissions: - contents: read - packages: read + permissions: {} + if: "! needs.build.outputs.self_mutation_happened" steps: - - name: Download CDK Construct build artifacts - uses: actions/download-artifact@v2 + - uses: actions/setup-node@v2 with: - name: cdk-construct-dist - path: packages/microapps-cdk/dist - + node-version: 14.x - name: Download Publish Tool build artifacts uses: actions/download-artifact@v2 with: name: publish-tool-dist path: packages/microapps-publish - - name: Download Datalib build artifacts uses: actions/download-artifact@v2 with: name: datalib-dist path: packages/microapps-datalib - - # - # Publish other non-JSII Artifacts to NPM - # - name: NPM registry authentication run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPMJSORG_PUBLISH_TOKEN }} - - - name: Release Publish Tool - NPM + - name: Release Publish Tool - NPM - Dry Run working-directory: packages/microapps-publish run: | npm publish --dry-run - - - name: Release DataLib - NPM + - name: Release DataLib - NPM - Dry Run working-directory: packages/microapps-datalib run: | npm publish --dry-run - container: - # https://hub.docker.com/r/jsii/superchain - image: jsii/superchain:1-buster-slim-node16 + package-js: + needs: [ build ] + runs-on: ubuntu-latest + permissions: {} + if: "! needs.build.outputs.self_mutation_happened" + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create js artifact + run: cd .repo && npx projen package:js + - name: Collect js Artifact + run: mv .repo/dist dist + package-java: + needs: build + runs-on: ubuntu-latest + permissions: {} + if: "! needs.build.outputs.self_mutation_happened" + steps: + - uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: 11.x + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create java artifact + run: cd .repo && npx projen package:java + - name: Collect java Artifact + run: mv .repo/dist dist + package-python: + needs: build + runs-on: ubuntu-latest + permissions: {} + if: "! needs.build.outputs.self_mutation_happened" + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create python artifact + run: cd .repo && npx projen package:python + - name: Collect python Artifact + run: mv .repo/dist dist + package-dotnet: + needs: build + runs-on: ubuntu-latest + permissions: {} + if: "! needs.build.outputs.self_mutation_happened" + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create dotnet artifact + run: cd .repo && npx projen package:dotnet + - name: Collect dotnet Artifact + run: mv .repo/dist dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93af70b1..2c5fa109 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,27 +2,19 @@ # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". name: Release Packages - on: - # push: - # branches: - # - main - # Building on pull request is only temporary - # pull_request: - # branches: [ main ] - workflow_dispatch: {} - jobs: # # CDK Construct # - build-cdk-construct: + release: name: Build CDK Construct runs-on: ubuntu-latest permissions: contents: write - packages: read + outputs: + latest_commit: ${{ steps.git_remote.outputs.latest_commit }} env: CI: "true" steps: @@ -30,294 +22,284 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Set git identity run: |- - git config user.name "Automation" + git config user.name "github-actions" git config user.email "github-actions@github.com" - - - name: Use Node.js 16 - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v2.2.0 with: node-version: 16 cache: 'yarn' cache-dependency-path: '**/yarn.lock' - - name: Install dependencies run: yarn install --frozen-lockfile - - # - name: Generate Projen Files - # working-directory: packages/microapps-cdk/ - # run: | - # yarn projen - - name: Build All TypeScript run: yarn build - - name: Run Node Tests env: NODE_ENV: test run: yarn test - - # - name: Move root NPM modules out of the way - # run: mv node_modules node_modules_hide - + # This is required because of hoisting of the + # `constructs` module, which causes `jsii` to fail to build - name: Install CDK Construct Deps working-directory: packages/microapps-cdk/ run: yarn install --frozen-lockfile - - # - name: Post Install Patch of api-gatewayv2 - # working-directory: packages/microapps-cdk/ - # run: npx patch-package - - - name: Build CDK Construct + - name: Prepare the Release working-directory: packages/microapps-cdk/ - run: | - npx projen release - + run: npx projen release - name: Apply Version to Everything (Deployer / Datalib) run: npm version v$(cat packages/microapps-cdk/dist/version.txt) --no-git-tag-version --workspaces - - name: Check for new commits id: git_remote - run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ - github.ref }} | cut -f1)" - + run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" - name: Upload version.txt if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v2.1.1 with: name: version-txt path: packages/microapps-cdk/dist/version.txt - - - if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} - name: Create release - working-directory: packages/microapps-cdk/ - run: | - gh release create v$(cat dist/version.txt) -F dist/changelog.md -t v$(cat dist/version.txt) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload CDK Construct Artifact if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v2.1.1 with: - name: cdk-construct-dist + name: build-artifact path: packages/microapps-cdk/dist - container: - # https://hub.docker.com/r/jsii/superchain - image: jsii/superchain:1-buster-slim-node16 - - + release_github: + name: Publish to GitHub Releases + needs: release + runs-on: ubuntu-latest + permissions: + contents: write + if: needs.release.outputs.latest_commit == github.sha + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Collect GitHub Metadata + run: mv .repo/dist dist + - name: Release + run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_REF: ${{ github.ref }} # # Publish Tool # - build-publish-tool: + release-publish-tool: + needs: release name: Build Publish Tool - needs: build-cdk-construct runs-on: ubuntu-latest - steps: - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Use Node.js 16 uses: actions/setup-node@v2 with: node-version: 16 cache: 'yarn' cache-dependency-path: '**/yarn.lock' - - name: Check for new commits id: git_remote - run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ - github.ref }} | cut -f1)" - + run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" - name: Download version.txt uses: actions/download-artifact@v2 with: name: version-txt path: dist - - name: Apply Version to Everything run: | cat dist/version.txt npm version v$(cat dist/version.txt) --no-git-tag-version --workspaces - - name: Install Node Modules run: yarn install --frozen-lockfile - - - name: Generate Projen Files - working-directory: packages/microapps-cdk/ - run: | - yarn projen - - name: Build Publish TypeScript run: yarn build:publish - - name: Run Lint run: yarn lint - - name: Upload Publish Tool artifact - if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} uses: actions/upload-artifact@v2 with: name: publish-tool-dist path: | packages/microapps-publish/ !packages/microapps-publish/node_modules/ - - name: Upload Datalib artifact - if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} uses: actions/upload-artifact@v2 with: name: datalib-dist path: | packages/microapps-datalib/ !packages/microapps-datalib/node_modules/ - - # - # Release Assets - # - release-assets: - name: Release Assets - needs: [ build-cdk-construct, build-publish-tool ] + release_npm: + name: Publish to npm + needs: release runs-on: ubuntu-latest permissions: contents: read - packages: write + if: needs.release.outputs.latest_commit == github.sha steps: - - name: Use Node.js 16 - uses: actions/setup-node@v2 + - uses: actions/setup-node@v2 with: - node-version: 16 - - - name: Download CDK Construct build artifacts + node-version: 14.x + - name: Download build artifacts uses: actions/download-artifact@v2 with: - name: cdk-construct-dist - path: packages/microapps-cdk/dist - + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create js artifact + run: cd .repo && npx projen package:js + - name: Collect js Artifact + run: mv .repo/dist dist + - name: Release + run: npx -p publib@latest publib-npm + env: + NPM_DIST_TAG: latest + NPM_REGISTRY: registry.npmjs.org + NPM_TOKEN: ${{ secrets.NPMJSORG_PUBLISH_TOKEN }} # publib requires NPM_TOKEN as an env var + release_npm_publish_tool: + name: Publish to npm + needs: [ release, release-publish-tool ] + runs-on: ubuntu-latest + permissions: + contents: read + if: needs.release.outputs.latest_commit == github.sha + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x - name: Download Publish Tool build artifacts uses: actions/download-artifact@v2 with: name: publish-tool-dist path: packages/microapps-publish - - name: Download Datalib build artifacts uses: actions/download-artifact@v2 with: name: datalib-dist path: packages/microapps-datalib - - # - # PyPI - # - # https://github.com/cdklabs/publib#pypi - - name: Release CDK Construct - PyPI - working-directory: packages/microapps-cdk - run: | - npx -p publib@latest publib-pypi - env: - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - - # Docs for GitHub Nuget - # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry - # Docs for publib-nuget - # https://github.com/cdklabs/publib#nuget - # - name: Release CDK Construct - GitHub NuGet - # run: cd packages/microapps-cdk && npx -p publib@latest publib-nuget - # env: - # NUGET_SERVER: https://nuget.pkg.github.com/pwrdrvr/index.json - # NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }} - - name: Release CDK Construct - NuGet.org - working-directory: packages/microapps-cdk/ - run: | - npx -p publib@latest publib-nuget - env: - NUGET_API_KEY: ${{ secrets.NUGET_MICROAPPS }} - - # Docs for GitHub Maven - # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry - # Docs for publib-maven - # https://github.com/cdklabs/publib#maven - # - name: Release CDK Construct - GitHub Maven - # working-directory: packages/microapps-cdk/ - # run: | - # npx -p publib@latest publib-maven - # env: - # MAVEN_SERVER_ID: github - # MAVEN_REPOSITORY_URL: https://maven.pkg.github.com/pwrdrvr/microapps-core - # MAVEN_USERNAME: ${{ github.actor }} - # MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - - name: Release CDK Construct - Maven Central - working-directory: packages/microapps-cdk/ - run: | - npx -p publib@latest publib-maven - env: - MAVEN_ENDPOINT: https://s01.oss.sonatype.org - MAVEN_STAGING_PROFILE_ID: 3127710ac57dbb - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }} - - # Docs for different release steps and params - # https://www.npmjs.com/package/publib - # Docs for publib-npm - # https://github.com/cdklabs/publib#npm - # - name: Release CDK Construct - GitHub NPM - # run: cd packages/microapps-cdk && npx -p publib@latest publib-npm - # env: - # NPM_DIST_TAG: latest - # NPM_REGISTRY: npm.pkg.github.com - # NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Release CDK Construct - npmjs.org - working-directory: packages/microapps-cdk - run: | - npx -p publib@latest publib-npm - env: - NPM_TOKEN: ${{ secrets.NPMJSORG_PUBLISH_TOKEN }} # publib requires NPM_TOKEN as an env var - - # - # Publish other non-JSII Artifacts to GitHub Packages - # - # - name: Release Publish Tool - GitHub NPM - # run: npm config set registry https://npm.pkg.github.com && cd packages/microapps-publish/dist && npm publish - # env: - # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: Release DataLib - GitHub NPM - # run: npm config set registry https://npm.pkg.github.com && cd packages/microapps-datalib/dist && npm publish - # env: - # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # # Publish other non-JSII Artifacts to NPM # - name: NPM registry authentication run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPMJSORG_PUBLISH_TOKEN }} - - name: Release Publish Tool - NPM working-directory: packages/microapps-publish/ run: | npm publish - - name: Release DataLib - NPM working-directory: packages/microapps-datalib/ run: | npm publish - - # - name: Github package registry authentication - # run: npm set //npm.pkg.github.com/:_authToken ${{ secrets.GPR_TOKEN }} - # - name: Npm registry authentication - # run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - # - name: Publish package to Github and Npm package registries - # run: npm publish - - container: - # https://hub.docker.com/r/jsii/superchain - image: jsii/superchain:1-buster-slim-node16 + release_maven: + name: Publish to Maven Central + needs: release + runs-on: ubuntu-latest + permissions: + contents: read + if: needs.release.outputs.latest_commit == github.sha + steps: + - uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: 11.x + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create java artifact + run: cd .repo && npx projen package:java + - name: Collect java Artifact + run: mv .repo/dist dist + - name: Release + run: npx -p publib@latest publib-maven + env: + MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_STAGING_PROFILE_ID: ${{ secrets.MAVEN_STAGING_PROFILE_ID }} + MAVEN_ENDPOINT: https://s01.oss.sonatype.org + release_pypi: + name: Publish to PyPI + needs: release + runs-on: ubuntu-latest + permissions: + contents: read + if: needs.release.outputs.latest_commit == github.sha + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create python artifact + run: cd .repo && npx projen package:python + - name: Collect python Artifact + run: mv .repo/dist dist + - name: Release + run: npx -p publib@latest publib-pypi + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + release_nuget: + name: Publish to NuGet Gallery + needs: release + runs-on: ubuntu-latest + permissions: + contents: read + if: needs.release.outputs.latest_commit == github.sha + steps: + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.x + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifact + path: dist + - name: Prepare Repository + run: mv dist .repo + - name: Install Dependencies + run: cd .repo && yarn install --check-files --frozen-lockfile + - name: Create dotnet artifact + run: cd .repo && npx projen package:dotnet + - name: Collect dotnet Artifact + run: mv .repo/dist dist + - name: Release + run: npx -p publib@latest publib-nuget + env: + NUGET_API_KEY: ${{ secrets.NUGET_MICROAPPS }}