Skip to content

chore(formatting): Test triggering new rc changes (#927) #2103

chore(formatting): Test triggering new rc changes (#927)

chore(formatting): Test triggering new rc changes (#927) #2103

Workflow file for this run

name: Publish CLI
on: push
env:
CI: true
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
jobs:
build_run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: rm -r node_modules
- run: npm ci --omit=dev
- run: ./bin/run --version
- run: rm -r node_modules/@oclif/plugin-warn-if-update-available/lib/hooks/ # Remove plugin-warn-if-update-available hook from showing warning
- run: | # Check if stderr is not empty and hard error (captures node warnings)
error=$(./bin/run --version 2>&1 >/dev/null)
[ ! -z "$error" ] && echo "$error" && exit 1 || echo "No error"
# Start webpack test for mangling/compressing
- run: npm ci
working-directory: ./test/webpack
- run: npm run webpack
working-directory: ./test/webpack
- run: node ./lib/main.js
working-directory: ./test/webpack
# End webpack test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run check-circular
test:
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
publish_cli:
name: Publish CLI
if: github.ref_name == 'main' || github.ref_name == 'rc' || startsWith(github.ref_name, 'arc-')
needs: [build_run, lint, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
clean: true
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run readme
- run: npm run generate:schema-docs
- run: npm run generate:yarn-lock
- name: npm publish
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISH_TOKEN }}" > ~/.npmrc
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) npm run semantic-release
publish_docs:
name: Publish Docs
if: github.ref_name == 'main'
needs: [publish_cli]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
clean: true
path: architect-cli
ref: main
- uses: actions/checkout@v3
with:
repository: architect-team/documentation
token: ${{ secrets.DOCS_GITHUB_TOKEN }}
clean: true
path: documentation
ref: main
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: node ./architect-cli/bin/readme-mdx.mjs ./documentation/reference/cli.mdx
- run: cp ./architect-cli/architect-yml.md ./documentation/reference/architect-yml.mdx
- run: cp ./architect-cli/CHANGELOG.md ./documentation/reference/changelog.mdx
- name: Commit
working-directory: ./documentation
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add -A
git diff-index --quiet HEAD || git commit -m "Update auto-generated files from CLI"
git push