|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [main] |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + |
| 9 | +jobs: |
| 10 | + release: |
| 11 | + name: Verify & Release |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + permissions: |
| 15 | + contents: write |
| 16 | + issues: write |
| 17 | + pull-requests: write |
| 18 | + id-token: write |
| 19 | + |
| 20 | + env: |
| 21 | + HAS_EXTENDED_TESTS: ${{ secrets.EXTENDED_REGRESSION_SSH_KEY != '' }} |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + path: shotstack-studio-sdk |
| 28 | + |
| 29 | + - uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: 22 |
| 32 | + |
| 33 | + - name: Install dependencies |
| 34 | + working-directory: shotstack-studio-sdk |
| 35 | + run: npm install |
| 36 | + |
| 37 | + - name: Run verification suite |
| 38 | + working-directory: shotstack-studio-sdk |
| 39 | + run: npm run verify:ci |
| 40 | + |
| 41 | + - name: Upload coverage report |
| 42 | + if: always() |
| 43 | + uses: actions/upload-artifact@v4 |
| 44 | + with: |
| 45 | + name: coverage-report |
| 46 | + path: shotstack-studio-sdk/coverage/ |
| 47 | + retention-days: 14 |
| 48 | + |
| 49 | + - name: "[Extended] Set up SSH for regression suite" |
| 50 | + if: env.HAS_EXTENDED_TESTS == 'true' |
| 51 | + uses: webfactory/ssh-agent@v0.9.0 |
| 52 | + with: |
| 53 | + ssh-private-key: ${{ secrets.EXTENDED_REGRESSION_SSH_KEY }} |
| 54 | + |
| 55 | + - name: "[Extended] Clone regression suite" |
| 56 | + if: env.HAS_EXTENDED_TESTS == 'true' |
| 57 | + run: git clone git@github.com:shotstack/shotstack-studio-extended-regression-suite.git |
| 58 | + |
| 59 | + - name: "[Extended] Install test dependencies" |
| 60 | + if: env.HAS_EXTENDED_TESTS == 'true' |
| 61 | + working-directory: shotstack-studio-extended-regression-suite |
| 62 | + run: npm install |
| 63 | + |
| 64 | + - name: "[Extended] Run behavioural regression tests" |
| 65 | + if: env.HAS_EXTENDED_TESTS == 'true' |
| 66 | + working-directory: shotstack-studio-extended-regression-suite |
| 67 | + run: npm test |
| 68 | + |
| 69 | + - name: Release |
| 70 | + working-directory: shotstack-studio-sdk |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + run: npx semantic-release |
0 commit comments