diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aeaa482a..3bab76d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,61 +35,61 @@ jobs: # - name: Test Code # run: npm run test -- --watchAll=false - # build: - # needs: [test] - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - # - uses: actions/setup-node@v3 - # with: - # node-version: 19.7 - - # - name: Setup Git - # run: | - # git config --local user.name cfl-bot - # git config --local user.email codeforlife-bot@users.noreply.github.com - - # # TODO: cache node packages - # - name: Install Node Packages - # run: npm install --only=dev - - # - name: Build Package - # run: npm run build - - # - name: Push Build Files - # run: | - # git add lib/* - # if ! git diff --staged --quiet; then - # git commit -m "push build files [skip ci]" - # git push - # fi - - # release: - # needs: [build] - # concurrency: release - # runs-on: ubuntu-latest - # if: github.ref == 'refs/heads/main' - # steps: - # - uses: actions/checkout@v3 - # with: - # token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - # fetch-depth: 0 - - # - name: Pull Build Files - # run: git pull - - # - uses: actions/setup-node@v3 - # with: - # node-version: 19.7 - - # # TODO: group release dependencies - # - name: Install Node Packages - # run: npm install --only=dev - - # - name: Publish Semantic Release - # env: - # GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - # run: npx semantic-release + build: + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - uses: actions/setup-node@v3 + with: + node-version: 19.7 + + - name: Setup Git + run: | + git config --local user.name cfl-bot + git config --local user.email codeforlife-bot@ocado.com + + # TODO: cache node packages + - name: Install Node Packages + run: npm install --only=dev + + - name: Build Package + run: npm run build + + - name: Push Build Files + run: | + git add lib/* + if ! git diff --staged --quiet; then + git commit -m "push build files [skip ci]" + git push + fi + + release: + needs: [build] + concurrency: release + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + fetch-depth: 0 + + - name: Pull Build Files + run: git pull + + - uses: actions/setup-node@v3 + with: + node-version: 19.7 + + # TODO: group release dependencies + - name: Install Node Packages + run: npm install --only=dev + + - name: Publish Semantic Release + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: npx semantic-release