From 38b9c767a0953e948ced4690dab10feeca7d7a8b Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 14 Jan 2024 22:04:33 +0100 Subject: [PATCH] Validation added --- .github/workflows/cd.yml | 9 ++- .github/workflows/validate_secrets.yml | 76 ++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/validate_secrets.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f6cf914..5ba7918 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -3,8 +3,8 @@ name: Publish Custom App on: release: types: [published] - branches: - - main + # branches: # TODO: uncomment this once all good + # - main # taken from: kiwix/apple .github/workflows/cd.yml env: @@ -16,15 +16,14 @@ env: jobs: generate_build_deploy: - runs-on: macos-13 strategy: fail-fast: false matrix: destination: - platform: macOS - platform: iOS - xcode_extra: -sdk iphoneos - + xcode_extra: -sdk iphoneos + runs-on: macos-13 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/validate_secrets.yml b/.github/workflows/validate_secrets.yml new file mode 100644 index 0000000..35ce0a7 --- /dev/null +++ b/.github/workflows/validate_secrets.yml @@ -0,0 +1,76 @@ +name: Validate if we have all secrets set for building + +on: + pull_request: + +jobs: + build: + runs-on: macos-13 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check if all required secrets were set + run: + | + if [ -z "${{ secrets.APPLE_DEVELOPMENT_SIGNING_CERTIFICATE }}" ]; then + echo "Error: APPLE_DEVELOPMENT_SIGNING_CERTIFICATE secret is not set." + else + echo "APPLE_DEVELOPMENT_SIGNING_CERTIFICATE is set." + fi + if [ -z "${{ secrets.APPLE_DEVELOPMENT_SIGNING_IDENTITY }}" ]; then + echo "Error: APPLE_DEVELOPMENT_SIGNING_IDENTITY secret is not set." + else + echo "APPLE_DEVELOPMENT_SIGNING_IDENTITY is set." + fi + if [ -z "${{ secrets.APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD }}" ]; then + echo "Error: APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD secret is not set." + else + echo "APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD is set." + fi + if [ -z "${{ secrets.APPLE_DISTRIBUTION_SIGNING_CERTIFICATE }}" ]; then + echo "Error: APPLE_DISTRIBUTION_SIGNING_CERTIFICATE secret is not set." + else + echo "APPLE_DISTRIBUTION_SIGNING_CERTIFICATE is set." + fi + if [ -z "${{ secrets.APPLE_DISTRIBUTION_SIGNING_P12_PASSWORD }}" ]; then + echo "Error: APPLE_DISTRIBUTION_SIGNING_P12_PASSWORD secret is not set." + else + echo "APPLE_DISTRIBUTION_SIGNING_P12_PASSWORD is set." + fi + if [ -z "${{ secrets.APPLE_SIGNING_ALTOOL_PASSWORD }}" ]; then + echo "Error: APPLE_SIGNING_ALTOOL_PASSWORD secret is not set." + else + echo "APPLE_SIGNING_ALTOOL_PASSWORD is set." + fi + if [ -z "${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }}" ]; then + echo "Error: APPLE_SIGNING_ALTOOL_USERNAME secret is not set." + else + echo "APPLE_SIGNING_ALTOOL_USERNAME is set." + fi + if [ -z "${{ secrets.APPLE_SIGNING_TEAM }}" ]; then + echo "Error: APPLE_SIGNING_TEAM secret is not set." + else + echo "APPLE_SIGNING_TEAM is set." + fi + if [ -z "${{ secrets.APPLE_STORE_AUTH_KEY }}" ]; then + echo "Error: APPLE_STORE_AUTH_KEY secret is not set." + else + echo "APPLE_STORE_AUTH_KEY is set." + fi + if [ -z "${{ secrets.APPLE_STORE_AUTH_KEY_ID }}" ]; then + echo "Error: APPLE_STORE_AUTH_KEY_ID secret is not set." + else + echo "APPLE_STORE_AUTH_KEY_ID is set." + fi + if [ -z "${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}" ]; then + echo "Error: APPLE_STORE_AUTH_KEY_ISSUER_ID secret is not set." + else + echo "APPLE_STORE_AUTH_KEY_ISSUER_ID is set." + fi + if [ -z "${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }}" ]; then + echo "Error: DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION secret is not set." + else + echo "DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION is set." + fi