release #30
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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". | |
name: release | |
on: | |
schedule: | |
- cron: 11 8 * * 5 | |
workflow_dispatch: {} | |
jobs: | |
release: | |
runs-on: awscdk-service-spec_ubuntu-latest_32-core | |
permissions: | |
contents: write | |
outputs: | |
latest_commit: ${{ steps.git_remote.outputs.latest_commit }} | |
publish-cdklabs-tskb: ${{ steps.check-publish-cdklabs-tskb.outputs.publish }} | |
publish-cdklabs-typewriter: ${{ steps.check-publish-cdklabs-typewriter.outputs.publish }} | |
publish-aws-cdk-service-spec-types: ${{ steps.check-publish-aws-cdk-service-spec-types.outputs.publish }} | |
publish-aws-cdk-aws-service-spec: ${{ steps.check-publish-aws-cdk-aws-service-spec.outputs.publish }} | |
env: | |
CI: "true" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
- name: Set git identity | |
run: |- | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.14.0 | |
- name: Install dependencies | |
run: yarn install --check-files --frozen-lockfile | |
- name: release | |
run: npx projen release | |
- id: check-publish-cdklabs-tskb | |
run: (git ls-remote -q --exit-code --tags origin $(cat dist/releasetag.txt) && (echo "publish=false" >> $GITHUB_OUTPUT)) || echo "publish=true" >> $GITHUB_OUTPUT | |
working-directory: packages/@cdklabs/tskb | |
- id: check-publish-cdklabs-typewriter | |
run: (git ls-remote -q --exit-code --tags origin $(cat dist/releasetag.txt) && (echo "publish=false" >> $GITHUB_OUTPUT)) || echo "publish=true" >> $GITHUB_OUTPUT | |
working-directory: packages/@cdklabs/typewriter | |
- id: check-publish-aws-cdk-service-spec-types | |
run: (git ls-remote -q --exit-code --tags origin $(cat dist/releasetag.txt) && (echo "publish=false" >> $GITHUB_OUTPUT)) || echo "publish=true" >> $GITHUB_OUTPUT | |
working-directory: packages/@aws-cdk/service-spec-types | |
- id: check-publish-aws-cdk-aws-service-spec | |
run: (git ls-remote -q --exit-code --tags origin $(cat dist/releasetag.txt) && (echo "publish=false" >> $GITHUB_OUTPUT)) || echo "publish=true" >> $GITHUB_OUTPUT | |
working-directory: packages/@aws-cdk/aws-service-spec | |
- name: Check for new commits | |
id: git_remote | |
run: echo "latest_commit=$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT | |
- name: "@cdklabs/tskb: Backup artifact permissions" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
run: cd dist && getfacl -R . > permissions-backup.acl | |
continue-on-error: true | |
working-directory: packages/@cdklabs/tskb | |
- name: "@cdklabs/tskb: Upload artifact" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cdklabs-tskb_build-artifact | |
path: packages/@cdklabs/tskb/dist | |
- name: "@cdklabs/typewriter: Backup artifact permissions" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
run: cd dist && getfacl -R . > permissions-backup.acl | |
continue-on-error: true | |
working-directory: packages/@cdklabs/typewriter | |
- name: "@cdklabs/typewriter: Upload artifact" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cdklabs-typewriter_build-artifact | |
path: packages/@cdklabs/typewriter/dist | |
- name: "@aws-cdk/service-spec-types: Backup artifact permissions" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
run: cd dist && getfacl -R . > permissions-backup.acl | |
continue-on-error: true | |
working-directory: packages/@aws-cdk/service-spec-types | |
- name: "@aws-cdk/service-spec-types: Upload artifact" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: aws-cdk-service-spec-types_build-artifact | |
path: packages/@aws-cdk/service-spec-types/dist | |
- name: "@aws-cdk/aws-service-spec: Backup artifact permissions" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
run: cd dist && getfacl -R . > permissions-backup.acl | |
continue-on-error: true | |
working-directory: packages/@aws-cdk/aws-service-spec | |
- name: "@aws-cdk/aws-service-spec: Upload artifact" | |
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: aws-cdk-aws-service-spec_build-artifact | |
path: packages/@aws-cdk/aws-service-spec/dist | |
cdklabs-tskb_release_github: | |
name: "@cdklabs/tskb: Publish to GitHub Releases" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-cdklabs-tskb == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: cdklabs-tskb_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_REF: ${{ github.ref }} | |
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 | |
cdklabs-tskb_release_npm: | |
name: "@cdklabs/tskb: Publish to npm" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-cdklabs-tskb == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: cdklabs-tskb_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
NPM_DIST_TAG: latest | |
NPM_REGISTRY: registry.npmjs.org | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx -p publib@latest publib-npm | |
cdklabs-typewriter_release_github: | |
name: "@cdklabs/typewriter: Publish to GitHub Releases" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-cdklabs-typewriter == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: cdklabs-typewriter_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_REF: ${{ github.ref }} | |
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 | |
cdklabs-typewriter_release_npm: | |
name: "@cdklabs/typewriter: Publish to npm" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-cdklabs-typewriter == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: cdklabs-typewriter_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
NPM_DIST_TAG: latest | |
NPM_REGISTRY: registry.npmjs.org | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx -p publib@latest publib-npm | |
aws-cdk-service-spec-types_release_github: | |
name: "@aws-cdk/service-spec-types: Publish to GitHub Releases" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-aws-cdk-service-spec-types == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: aws-cdk-service-spec-types_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_REF: ${{ github.ref }} | |
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 | |
aws-cdk-service-spec-types_release_npm: | |
name: "@aws-cdk/service-spec-types: Publish to npm" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-aws-cdk-service-spec-types == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: aws-cdk-service-spec-types_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
NPM_DIST_TAG: latest | |
NPM_REGISTRY: registry.npmjs.org | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx -p publib@latest publib-npm | |
aws-cdk-aws-service-spec_release_github: | |
name: "@aws-cdk/aws-service-spec: Publish to GitHub Releases" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-aws-cdk-aws-service-spec == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: aws-cdk-aws-service-spec_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_REF: ${{ github.ref }} | |
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 | |
aws-cdk-aws-service-spec_release_npm: | |
name: "@aws-cdk/aws-service-spec: Publish to npm" | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
if: ${{ needs.release.outputs.latest_commit == github.sha && needs.release.outputs.publish-aws-cdk-aws-service-spec == 'true' }} | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: aws-cdk-aws-service-spec_build-artifact | |
path: dist | |
- name: Restore build artifact permissions | |
run: cd dist && setfacl --restore=permissions-backup.acl | |
continue-on-error: true | |
- name: Release | |
env: | |
NPM_DIST_TAG: latest | |
NPM_REGISTRY: registry.npmjs.org | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx -p publib@latest publib-npm |