Merge pull request #273 from voxeet/open_session_before_preview_screen #477
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: Snapshot build and publish | |
on: | |
push: | |
branches-ignore: | |
- 'master' | |
- 'release-**' | |
jobs: | |
build: | |
runs-on: [self-hosted, Linux] | |
container: | |
image: 836782323787.dkr.ecr.us-east-1.amazonaws.com/node-git:16.9.1-2 | |
env: | |
codeartifact_run: ${{secrets.CODEARTIFACT_RUN}} | |
codeartifact_snapshots_registry_url: ${{ secrets.CODEARTIFACT_NPM_SNAPSHOTS_REPOSITORY_URL }} | |
jfrog_production_registry_url: ${{ secrets.JFA_NPM_PRODUCTION_REGISTRY_URL }} | |
jfrog_snapshots_registry_url: ${{ secrets.JFA_NPM_SNAPSHOTS_REGISTRY_URL }} | |
NPM_CONFIG_USERCONFIG: ${{ github.workspace }}/.npmrc | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/github-slug-action-3.7.1 | |
- name: Configure AWS Credentials | |
uses: ./.github/actions/configure-aws-credentials-1.7.0 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: install from aws | |
run: | | |
echo "Install dependencies from AWS Codeartifact" | |
aws codeartifact login --duration-seconds 900 --tool npm --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_DOMAIN_OWNER }} --repository 'npm-releases' --region ${{ secrets.AWS_REGION }} | |
echo "always-auth=true" >> ${NPM_CONFIG_USERCONFIG} | |
npm --version | |
yarn install | |
if: ${{ env.codeartifact_run == 'true' }} | |
- name: install from jfrog | |
run: | | |
echo "Install dependencies from JFrog Artifactory." | |
printf "_auth=${{ secrets.JFA_AUTH_TOKEN }}\nalways-auth=true\nemail=buildteam@dolby.com\nregistry=${{ env.jfrog_production_registry_url }}\n" > ${NPM_CONFIG_USERCONFIG} | |
yarn install | |
if: ${{ env.codeartifact_run == 'false' }} | |
- name: build publish and create NPM dist tag | |
run: | | |
printf "_auth=${{ secrets.JFA_AUTH_TOKEN }}\nalways-auth=true\nemail=buildteam@dolby.com\nregistry=${{ env.jfrog_snapshots_registry_url }}\n" > ${NPM_CONFIG_USERCONFIG} | |
npm --no-git-tag-version version $(npm run --silent get-version)-$GITHUB_SHA | |
yarn publish --tag ${{ env.GITHUB_REF_SLUG }} | |
- name: publish on AWS | |
run: | | |
aws codeartifact login --duration-seconds 900 --tool npm --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_DOMAIN_OWNER }} --repository 'npm-snapshots' --region ${{ secrets.AWS_REGION }} | |
npm publish --tag ${{ env.GITHUB_REF_SLUG }} --registry ${{ env.codeartifact_snapshots_registry_url }} | |
if: ${{ env.codeartifact_run == 'false' }} | |
- name: publish on JFrog | |
run: | | |
printf "_auth=${{ secrets.JFA_AUTH_TOKEN }}\nalways-auth=true\nemail=buildteam@dolby.com\nregistry=${{ env.JFA_NPM_REGISTRY_URL }}\n" > ${NPM_CONFIG_USERCONFIG} | |
npm publish --tag ${{ env.GITHUB_REF_SLUG }} --registry ${{ env.jfrog_snapshots_registry_url }} | |
if: ${{ env.codeartifact_run == 'true' }} | |
env: | |
JFA_NPM_REGISTRY_URL: ${{ secrets.JFA_NPM_SNAPSHOTS_REGISTRY_URL }} | |
- name: Generate github app token | |
id: generate_token | |
uses: ./.github/actions/github-app-token-1.8.0 | |
with: | |
app_id: ${{ secrets.VOXEET_IO_WEB_APP_ID }} | |
private_key: ${{ secrets.VOXEET_IO_WEB_APP_PRIVATE_KEY }} | |
repository: voxeet/voxeet-io-web | |
- name: Send repository dispatch to voxeet-io-web | |
uses: ./.github/actions/repository-dispatch-2.1.1 | |
continue-on-error: true | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
event-type: uxkit-${{ env.GITHUB_REF_SLUG }} | |
repository: voxeet/voxeet-io-web |