Skip to content

Commit

Permalink
fix: test apollo release
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Baliasnikov committed Nov 10, 2023
1 parent db7ebee commit 8fd52ff
Showing 1 changed file with 19 additions and 67 deletions.
86 changes: 19 additions & 67 deletions .github/workflows/Deployment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# kics-scan ignore
name: Deployment
name: Release Apollo

defaults:
run:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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: >
Expand All @@ -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

0 comments on commit 8fd52ff

Please sign in to comment.