From 8fd52ffd58876ba043854a5ebe5d384b7805bd46 Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Fri, 10 Nov 2023 16:18:40 +0000 Subject: [PATCH] fix: test apollo release --- .github/workflows/Deployment.yml | 86 +++++++------------------------- 1 file changed, 19 insertions(+), 67 deletions(-) diff --git a/.github/workflows/Deployment.yml b/.github/workflows/Deployment.yml index 7aa065fca..d9124b45e 100644 --- a/.github/workflows/Deployment.yml +++ b/.github/workflows/Deployment.yml @@ -1,6 +1,6 @@ --- # kics-scan ignore -name: Deployment +name: Release Apollo defaults: run: @@ -12,17 +12,14 @@ concurrency: env: JAVA_VERSION: 11 - NODEJS_VERSION: 16.17.0 ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} + GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} on: workflow_dispatch: - inputs: - tag: - description: 'Create release with tag' - required: true - type: string jobs: deployment: @@ -32,20 +29,8 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Cache gradle - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - ~/.konan - key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}" - restore-keys: | - ${{ runner.os }}-gradle- + token: ${{ secrets.ATALA_GITHUB_TOKEN }} + fetch-depth: 0 - name: "Install Java ${{ env.JAVA_VERSION }}" uses: actions/setup-java@v3 @@ -56,7 +41,7 @@ jobs: - name: "Install NodeJS ${{ env.NODEJS_VERSION }}" uses: actions/setup-node@v3 with: - node-version: "${{ env.NODEJS_VERSION }}" + node-version: "lts/*" - name: Install Homebrew run: > @@ -67,52 +52,19 @@ jobs: run: | brew install autoconf automake libtool - - name: Create Swift Package - env: - TAG_VERSION: ${{github.event.inputs.tag}} - run: | - ./gradlew :apollo:createSwiftPackage - - - name: Zip framework - run: | - target_dir_name="Apollo.xcframework" - source_dir="./apollo/build/packages/ApolloSwift/" - zip_name="Apollo.xcframework.zip" - (cd $source_dir && zip -r "$zip_name" $target_dir_name) - - - name: Prepare release package - run: | - checksum=$(swift package compute-checksum "apollo/build/packages/ApolloSwift/Apollo.xcframework.zip") - echo "CHECKSUM: $checksum" - rm -f Package.swift || true - ./.scripts/updatePackage.swift ${{github.event.inputs.tag}} "$checksum" "./.scripts/TemplatePackage.swift" "Package.swift" - - - name: Commit package - uses: stefanzweifel/git-auto-commit-action@v5 - env: - GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} - GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} - with: - commit_message: "chore: prepare release ${{github.event.inputs.tag}}" - tagging_message: ${{github.event.inputs.tag}} - commit_options: -S --signoff - - - name: Upload swift package artifacts - uses: actions/upload-artifact@v3 - with: - name: Apollo.xcframework.zip - path: apollo/build/packages/ApolloSwift/Apollo.xcframework.zip - - - name: Add swift package artifacts to release - uses: svenstaro/upload-release-action@v2 + - uses: crazy-max/ghaction-import-gpg@v5 + id: import_gpg with: - tag: ${{github.event.inputs.tag}} - file: apollo/build/packages/ApolloSwift/Apollo.xcframework.zip - asset_name: "Apollo.xcframework.zip" + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + git_user_signingkey: true + git_commit_gpgsign: true - - name: Publish Maven artifacts to Github Packages + - name: Release env: - TAG_VERSION: ${{github.event.inputs.tag}} - id: publish + GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }} + GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }} + GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }} + GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }} run: | - ./gradlew publishAllPublicationsToGitHubPackagesRepository :apollo:publishJsPackageToGithubRegistry + npm install + npx semantic-release