diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d97811..cb5e35a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,85 +57,23 @@ jobs: python-version: 3.12.3 - name: Install NPM dependencies run: npx projen install:ci - - name: release + - name: Build + run: npx projen build --verbose + - name: Release run: npx projen release - - name: Backup artifact permissions - run: cd dist && getfacl -R . > permissions-backup.acl - continue-on-error: true - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: build-artifact - path: dist - name: Release GitHub 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 - release_npm: - name: Publish to npm - needs: release_github - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Download build artifacts - uses: actions/download-artifact@v3 - with: - name: build-artifact - path: dist - - name: Restore build artifact permissions - run: cd dist && setfacl --restore=permissions-backup.acl - continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Install Dependencies - run: cd .repo && npx projen install:ci - - name: Create JS artifact - run: cd .repo && npx projen package:js - - name: Collect js Artifact - run: mv .repo/dist dist - name: Release JS Artifact env: NPM_DIST_TAG: latest NPM_REGISTRY: registry.npmjs.org NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx -p publib@latest publib-npm - release_maven: - name: Publish to Maven Central - needs: release_github - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: '17.x' - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Download build artifacts - uses: actions/download-artifact@v3 - with: - name: build-artifact - path: dist - - name: Restore build artifact permissions - run: cd dist && setfacl --restore=permissions-backup.acl - continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Install Dependencies - run: cd .repo && npx projen install:ci - - name: Create java artifact - run: cd .repo && npx projen package:java - - name: Collect java Artifact - run: mv .repo/dist dist - - name: Release + - name: Release Java Artifact env: MAVEN_SERVER_ID: 'github' MAVEN_REPOSITORY_URL: 'https://maven.pkg.github.com/cargo-lambda/cargo-lambda-cdk' @@ -143,103 +81,16 @@ jobs: MAVEN_USERNAME: ${{ github.actor }} MAVEN_PASSWORD: ${{ secrets.CDK_PACKAGES_REGISTRY_GITHUB_TOKEN }} run: npx -p publib@latest publib-maven - release_pypi: - name: Publish to PyPI - needs: release_github - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - uses: actions/setup-python@v5 - with: - python-version: 3.12.3 - - name: Download build artifacts - uses: actions/download-artifact@v3 - with: - name: build-artifact - path: dist - - name: Restore build artifact permissions - run: cd dist && setfacl --restore=permissions-backup.acl - continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Install Dependencies - run: cd .repo && npx projen install:ci - - name: Create python artifact - run: cd .repo && npx projen package:python - - name: Collect python Artifact - run: mv .repo/dist dist - - name: Release + - name: Release Python Artifact env: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: npx -p publib@latest publib-pypi - release_nuget: - name: Publish to NuGet Gallery - needs: release_github - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 3.x - - name: Download build artifacts - uses: actions/download-artifact@v3 - with: - name: build-artifact - path: dist - - name: Restore build artifact permissions - run: cd dist && setfacl --restore=permissions-backup.acl - continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Install Dependencies - run: cd .repo && npx projen install:ci - - name: Create dotnet artifact - run: cd .repo && npx projen package:dotnet - - name: Collect dotnet Artifact - run: mv .repo/dist dist - - name: Release + - name: Release Dotnet Artifact env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} run: npx -p publib@latest publib-nuget - release_golang: - name: Publish to GitHub Go Module Repository - needs: release_github - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - uses: actions/setup-go@v4 - with: - go-version: ^1.16.0 - - name: Download build artifacts - uses: actions/download-artifact@v3 - with: - name: build-artifact - path: dist - - name: Restore build artifact permissions - run: cd dist && setfacl --restore=permissions-backup.acl - continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Install Dependencies - run: cd .repo && npx projen install:ci - - name: Create go artifact - run: cd .repo && npx projen package:go - - name: Collect go Artifact - run: mv .repo/dist dist - - name: Release + - name: Release Go Artifact env: GIT_USER_NAME: github-actions GIT_USER_EMAIL: github-actions@github.com