Skip to content

[CD] plugin-swift

[CD] plugin-swift #65

Workflow file for this run

name: CD
on:
pull_request:
types: [closed]
branches:
- main
jobs:
interface:
if: |
startsWith(github.event.pull_request.title, '[CD]') != true &&
github.event.pull_request.user.login != 'github-actions'
runs-on: ubuntu-latest
timeout-minutes: 60
defaults:
run:
working-directory: ./interface
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Deploy
run: yarn deploy
env:
POLYWRAP_WRAPSCAN_AUTH_HEADER_PROD: ${{secrets.POLYWRAP_WRAPSCAN_AUTH_HEADER_PROD}}
- name: PR New URI
uses: peter-evans/create-pull-request@v3
with:
branch: interface-cd-pr-${{github.event.number}}
commit-message: "[CD] interface"
title: "[CD] interface"
body: "Triggered by: https://github.com/${{github.repository}}/pull/${{github.event.number}}"
getImplementations:
if: |
startsWith(github.event.pull_request.title, '[CD]') != true &&
github.event.pull_request.user.login != 'github-actions'
runs-on: ubuntu-latest
outputs:
matrix: ${{ env.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- id: set-matrix
run: echo "matrix=$(./scripts/getImplementations.sh)" >> $GITHUB_ENV
implementations-cd:
if: |
startsWith(github.event.pull_request.title, '[CD]') != true &&
github.event.pull_request.user.login != 'github-actions'
runs-on: ubuntu-latest
needs:
- interface
- getImplementations
strategy:
matrix: ${{fromJSON(needs.getImplementations.outputs.matrix)}}
defaults:
run:
working-directory: ./implementations/${{ matrix.package }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Deploy
run: yarn deploy
env:
POLYWRAP_WRAPSCAN_AUTH_HEADER_PROD: ${{secrets.POLYWRAP_WRAPSCAN_AUTH_HEADER_PROD}}
- name: PR New URI
uses: peter-evans/create-pull-request@v3
with:
branch: ${{ matrix.package }}-cd-pr-${{github.event.number}}
commit-message: "[CD] ${{ matrix.package }}"
title: "[CD] ${{ matrix.package }}"
body: "Triggered by: https://github.com/${{github.repository}}/pull/${{github.event.number}}"