Release (Requires manual steps to take, check all jobs are successful) #77
Workflow file for this run
This file contains hidden or 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
| name: Release (Requires manual steps to take) | |
| on: workflow_dispatch | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| env: | |
| CI: "true" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set git config safe.directory | |
| run: git config --global --add safe.directory "$(pwd)" | |
| - 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@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 18.x | |
| - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 | |
| name: Setup Java | |
| with: | |
| distribution: temurin | |
| java-version: 11.x | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c | |
| name: Setup Python | |
| with: | |
| python-version: 3.x | |
| - uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 | |
| name: Setup .NET | |
| with: | |
| dotnet-version: 9.0.x | |
| - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 | |
| name: Setup Go | |
| with: | |
| go-version: ^1.16.0 | |
| - name: Install dependencies | |
| run: yarn install --check-files --frozen-lockfile | |
| - name: release | |
| run: | | |
| unset CI # enable full package-all https://github.com/mongodb/awscdk-resources-mongodbatlas/blob/main/.projen/tasks.json#L157-L170 | |
| npx projen release | |
| - name: Backup artifact permissions | |
| run: cd dist && getfacl -R . > permissions-backup.acl | |
| continue-on-error: true | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | |
| with: | |
| name: build-artifact | |
| path: dist | |
| overwrite: true | |
| release_pypi: | |
| name: Publish to PyPI | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 18.x | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c | |
| with: | |
| python-version: 3.x | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 | |
| with: | |
| name: build-artifact | |
| path: dist | |
| - name: Restore build artifact permissions | |
| run: cd dist && setfacl --restore=permissions-backup.acl | |
| continue-on-error: true | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec | |
| with: | |
| gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.APIX_BOT_GPG_PASSPHRASE }} | |
| - name: GPG sign PyPI distributions | |
| run: | | |
| for file in dist/python/*.whl dist/python/*.tar.gz; do | |
| if [ -f "$file" ]; then | |
| gpg --batch --yes --pinentry-mode loopback --passphrase "$APIX_BOT_GPG_PASSPHRASE" --detach-sign -a "$file" | |
| fi | |
| done | |
| env: | |
| APIX_BOT_GPG_PASSPHRASE: ${{ secrets.APIX_BOT_GPG_PASSPHRASE }} | |
| - name: Upload to PyPI | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
| run: | | |
| pip install twine | |
| twine upload dist/python/*.whl dist/python/*.tar.gz | |
| - name: Extract Version | |
| id: extract-version | |
| if: ${{ failure() }} | |
| run: echo "VERSION=$(cat dist/version.txt)" >> "${GITHUB_OUTPUT}" |