Release Apollo #13
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
--- | |
# kics-scan ignore | |
name: Deployment | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ${{ github.head_ref }}${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
JAVA_VERSION: 11 | |
NODEJS_VERSION: 16.17.0 | |
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} | |
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Create release with tag' | |
required: true | |
type: string | |
jobs: | |
deployment: | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
os-type: macos | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout the repo | |
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- | |
- name: "Install Java ${{ env.JAVA_VERSION }}" | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "${{ env.JAVA_VERSION }}" | |
distribution: zulu | |
- name: "Install NodeJS ${{ env.NODEJS_VERSION }}" | |
if: matrix.os-type == 'linux' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "${{ env.NODEJS_VERSION }}" | |
- name: Install Homebrew | |
if: matrix.os-type == 'macos' | |
run: > | |
/bin/bash -c "$(curl -fsSL | |
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
- name: "Install autoconf, automake, libtool" | |
if: matrix.os-type == 'macos' | |
run: | | |
brew install autoconf automake libtool | |
- name: Create Swift Package | |
run: | | |
./gradlew :base-asymmetric-encryption:createSwiftPackage | |
- name: Zip framework | |
run: | | |
target_dir_name="Apollo.xcframework" | |
source_dir="./base-asymmetric-encryption/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 'base-asymmetric-encryption/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 | |
with: | |
commit_message: "chore: prepare release ${{github.event.inputs.tag}}" | |
tagging_message: ${{github.event.inputs.tag}} | |
- name: Upload swift package artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Apollo.xcframework.zip | |
path: base-asymmetric-encryption/build/packages/ApolloSwift/Apollo.xcframework.zip | |
- name: Add swift package artifacts to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: ${{github.event.inputs.tag}} | |
file: base-asymmetric-encryption/build/packages/ApolloSwift/Apollo.xcframework.zip | |
asset_name: "Apollo.xcframework.zip" | |
- name: Publish Maven artifacts to Github Packages | |
id: publish | |
run: | | |
./gradlew publishAllPublicationsToGitHubPackagesRepository :base-asymmetric-encryption:publishJsPackageToGithubRegistry | |