diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..5ece1a09 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,47 @@ +name: Build +on: [push] + +env: + CI_BUILD_NUM: ${{ github.run_id }} + CI_BRANCH: ${{ github.ref_name }} + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - run: npm ci + - run: npm run lint + - run: npm test + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - name: Semantic Release (Dry Run) + run: npm run semantic-release-dry + env: + GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} + + release: + name: Release + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - run: npm ci + - run: npm run semantic-release + env: + GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml deleted file mode 100644 index 234beb1f..00000000 --- a/.github/workflows/semantic-release.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Semantic Release -on: - push: - branches: - - 'main' - -jobs: - build: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - name: Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - name: Authenticate with Registry - run: | - echo "registry=https://registry.npmjs.org/" > .npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc - npm whoami - env: - NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} - - run: npm ci - - run: npm run lint - - run: npm test - - run: npm run semantic-release - env: - GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}