mono-repo [release] [tags] #43
Workflow file for this run
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
name: mono-repo [tags] | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment of release' | |
type: environment | |
default: Development | |
required: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
EnvSetup: | |
name: Setup | |
runs-on: ubuntu-latest | |
environment: ${{inputs.environment}} | |
outputs: | |
#Name | |
NX_NAME: ${{ steps.set-output-defaults.outputs.NX_NAME}} | |
#Variant | |
NX_VARIANT: ${{ steps.set-output-defaults.outputs.NX_VARIANT}} | |
#Chrome Extension | |
NX_CHROME_EXTENSION_ID: ${{ steps.set-output-defaults.outputs.NX_CHROME_EXTENSION_ID}} | |
#Edge Extension | |
NX_EDGE_EXTENSION_ID: ${{ steps.set-output-defaults.outputs.NX_EDGE_EXTENSION_ID}} | |
#i18n | |
NX_I18N: ${{steps.set-output-defaults.outputs.NX_I18N}} | |
#Google Analytics | |
NX_GOOGLE_ANALYTICS_ID: ${{steps.set-output-defaults.outputs.NX_GOOGLE_ANALYTICS_ID}} | |
#Google Adsense | |
NX_GOOGLE_ADS_SLOT: ${{steps.set-output-defaults.outputs.NX_GOOGLE_ADS_SLOT}} | |
NX_GOOGLE_ADS_CLIENT: ${{steps.set-output-defaults.outputs.NX_GOOGLE_ADS_CLIENT}} | |
# Public URL | |
PUBLIC_URL: ${{ steps.set-output-defaults.outputs.PUBLIC_URL}} | |
# Extension | |
UNINSTALL_URL: ${{ steps.set-output-defaults.outputs.UNINSTALL_URL}} | |
TRACKING_ID: ${{ steps.set-output-defaults.outputs.TRACKING_ID}} | |
FUNCTION_URL: ${{ steps.set-output-defaults.outputs.FUNCTION_URL}} | |
DISCORD_CLIENT_ID: ${{ steps.set-output-defaults.outputs.DISCORD_CLIENT_ID}} | |
OAUTH_CLIENT_ID: ${{ steps.set-output-defaults.outputs.OAUTH_CLIENT_ID}} | |
#version | |
NX_RELEASE_VERSION: ${{ steps.set-output-defaults.outputs.NX_RELEASE_VERSION}} | |
#Sentry | |
SENTRY_AUTH_TOKEN: ${{ steps.set-output-defaults.outputs.SENTRY_AUTH_TOKEN}} | |
steps: | |
- name: set outputs with default values | |
id: set-output-defaults | |
run: | | |
echo "NX_NAME=${{ vars.NX_NAME }}" >> $GITHUB_OUTPUT | |
echo "NX_VARIANT=${{ vars.NX_VARIANT }}" >> $GITHUB_OUTPUT | |
echo "NX_CHROME_EXTENSION_ID=${{ vars.NX_CHROME_EXTENSION_ID }}" >> $GITHUB_OUTPUT | |
echo "NX_EDGE_EXTENSION_ID=${{ vars.NX_EDGE_EXTENSION_ID || 'DEV' }}" >> $GITHUB_OUTPUT | |
echo "NX_I18N=${{ vars.NX_I18N }}" >> $GITHUB_OUTPUT | |
echo "NX_GOOGLE_ANALYTICS_ID=${{ vars.NX_GOOGLE_ANALYTICS_ID }}" >> $GITHUB_OUTPUT | |
echo "NX_GOOGLE_ADS_SLOT=${{ vars.NX_GOOGLE_ADS_SLOT }}" >> $GITHUB_OUTPUT | |
echo "NX_GOOGLE_ADS_CLIENT=${{ vars.NX_GOOGLE_ADS_CLIENT }}" >> $GITHUB_OUTPUT | |
echo "UNINSTALL_URL=${{ vars.UNINSTALL_URL }}" >> $GITHUB_OUTPUT | |
echo "TRACKING_ID=${{ vars.TRACKING_ID }}" >> $GITHUB_OUTPUT | |
echo "FUNCTION_URL=${{ vars.FUNCTION_URL }}" >> $GITHUB_OUTPUT | |
echo "DISCORD_CLIENT_ID='${{ vars.DISCORD_CLIENT_ID }}'" >> $GITHUB_OUTPUT | |
echo "OAUTH_CLIENT_ID=${{ vars.OAUTH_CLIENT_ID }}" >> $GITHUB_OUTPUT | |
echo "PUBLIC_URL=${{ vars.PUBLIC_URL }}" >> $GITHUB_OUTPUT | |
echo "NX_RELEASE_VERSION=${{github.ref_name}}" >> $GITHUB_OUTPUT | |
echo "SENTRY_AUTH_TOKEN=${{ vars.SENTRY_AUTH_TOKEN }}" >> $GITHUB_OUTPUT | |
main: | |
needs: [EnvSetup] | |
name: Nx Cloud - Main Job | |
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.14.0 | |
secrets: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
with: | |
artifacts-path: 'dist/apps/*' | |
environment-variables: | | |
NX_NAME=${{needs.EnvSetup.outputs.NX_NAME}} | |
NX_VARIANT=${{needs.EnvSetup.outputs.NX_VARIANT}} | |
NX_CHROME_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_CHROME_EXTENSION_ID}} | |
NX_EDGE_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_EDGE_EXTENSION_ID}} | |
NX_I18N=${{needs.EnvSetup.outputs.NX_I18N}} | |
NX_GOOGLE_ANALYTICS_ID=${{needs.EnvSetup.outputs.NX_GOOGLE_ANALYTICS_ID}} | |
NX_GOOGLE_ADS_SLOT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_SLOT}} | |
NX_GOOGLE_ADS_CLIENT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_CLIENT}} | |
UNINSTALL_URL=${{needs.EnvSetup.outputs.UNINSTALL_URL}} | |
TRACKING_ID=${{needs.EnvSetup.outputs.TRACKING_ID}} | |
FUNCTION_URL=${{needs.EnvSetup.outputs.FUNCTION_URL}} | |
DISCORD_CLIENT_ID=${{needs.EnvSetup.outputs.DISCORD_CLIENT_ID}} | |
OAUTH_CLIENT_ID=${{needs.EnvSetup.outputs.OAUTH_CLIENT_ID}} | |
PUBLIC_URL=${{needs.EnvSetup.outputs.PUBLIC_URL}} | |
NX_RELEASE_VERSION=${{needs.EnvSetup.outputs.NX_RELEASE_VERSION}} | |
SENTRY_AUTH_TOKEN=${{needs.EnvSetup.outputs.SENTRY_AUTH_TOKEN}} | |
parallel-commands-on-agents: | | |
npx nx run-many --target=build --parallel=3 --exclude='tag:puppeteer' --skip-nx-cache --base-href ${{needs.EnvSetup.outputs.PUBLIC_URL}} | |
final-commands: | | |
EXTENSION_TARGET_FILE="./dist/apps/acf-extension/manifest.json" | |
# Use an if-else statement to check if the file exists. | |
if [ -f "$EXTENSION_TARGET_FILE" ] | |
then | |
npx web-ext build --sourceDir="./dist/apps/acf-extension" --artifactsDir="./dist/apps" | |
else | |
echo "$EXTENSION_TARGET_FILE does not exist." | |
fi | |
agents: | |
needs: [EnvSetup] | |
name: Nx Cloud - Agents | |
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.14.0 | |
secrets: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
with: | |
number-of-agents: 2 | |
environment-variables: | | |
NX_NAME=${{needs.EnvSetup.outputs.NX_NAME}} | |
NX_VARIANT=${{needs.EnvSetup.outputs.NX_VARIANT}} | |
NX_CHROME_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_CHROME_EXTENSION_ID}} | |
NX_EDGE_EXTENSION_ID=${{needs.EnvSetup.outputs.NX_EDGE_EXTENSION_ID}} | |
NX_I18N=${{needs.EnvSetup.outputs.NX_I18N}} | |
NX_GOOGLE_ANALYTICS_ID=${{needs.EnvSetup.outputs.NX_GOOGLE_ANALYTICS_ID}} | |
NX_GOOGLE_ADS_SLOT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_SLOT}} | |
NX_GOOGLE_ADS_CLIENT=${{needs.EnvSetup.outputs.NX_GOOGLE_ADS_CLIENT}} | |
UNINSTALL_URL=${{needs.EnvSetup.outputs.UNINSTALL_URL}} | |
TRACKING_ID=${{needs.EnvSetup.outputs.TRACKING_ID}} | |
FUNCTION_URL=${{needs.EnvSetup.outputs.FUNCTION_URL}} | |
DISCORD_CLIENT_ID=${{needs.EnvSetup.outputs.DISCORD_CLIENT_ID}} | |
OAUTH_CLIENT_ID=${{needs.EnvSetup.outputs.OAUTH_CLIENT_ID}} | |
PUBLIC_URL=${{needs.EnvSetup.outputs.PUBLIC_URL}} | |
NX_RELEASE_VERSION=${{needs.EnvSetup.outputs.NX_RELEASE_VERSION}} | |
SENTRY_AUTH_TOKEN=${{needs.EnvSetup.outputs.SENTRY_AUTH_TOKEN}} | |
extension: | |
needs: [EnvSetup, agents, main] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
name: Extension | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: nx-main-artifacts | |
- uses: softprops/action-gh-release@v1 | |
if: ${{ hashFiles('auto_clicker_-_autofill*.zip') }} | |
id: extension-release | |
with: | |
draft: ${{ needs.EnvSetup.outputs.NX_VARIANT == 'DEV' }} | |
prerelease: ${{ needs.EnvSetup.outputs.NX_VARIANT == 'BETA' }} | |
generate_release_notes: true | |
files: 'auto_clicker_-_autofill*.zip' | |
fail_on_unmatched_files: true | |
configuration: | |
needs: [agents, main] | |
permissions: | |
contents: read | |
pull-requests: write | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{inputs.environment}} | |
url: ${{vars.PUBLIC_URL}} | |
name: Configuration | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: nx-main-artifacts | |
- name: Build And Deploy | |
if: ${{ hashFiles('acf-options-page/') != '' }} | |
id: deploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: 'upload' | |
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | |
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | |
app_location: 'acf-options-page' # App source code path | |
api_location: '' # Api source code path - optional | |
skip_app_build: true | |
skip_api_build: true | |
output_location: '' # Built app content directory - optional | |
###### End of Repository/Build Configurations ###### | |
tag: | |
needs: [EnvSetup, extension, configuration] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set ${{needs.EnvSetup.outputs.NX_VARIANT}} Tag | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
force_push_tag: true | |
tag: '${{needs.EnvSetup.outputs.NX_VARIANT}}' |