|
| 1 | +env: |
| 2 | + RUNNER_DEBUG: 1 |
| 3 | + |
| 4 | +name: 'CI' |
| 5 | +on: # rebuild any PRs and main branch changes |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +permissions: {} |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: # make sure build/ci work properly |
| 15 | + runs-on: ubuntu-latest |
| 16 | + permissions: |
| 17 | + contents: read |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 20 | + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 21 | + with: |
| 22 | + node-version: '22' |
| 23 | + - run: | |
| 24 | + npm install |
| 25 | + npm run all |
| 26 | + - run: | |
| 27 | + git diff --exit-code ':!dist/index.js.map' ':!badges/coverage.svg' |
| 28 | + test: # make sure the action works on a clean machine without building |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + permissions: |
| 31 | + contents: read |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 37 | + - uses: ./ |
| 38 | + - name: Get the version |
| 39 | + run: vals version |
| 40 | + - uses: ./ |
| 41 | + with: |
| 42 | + version: v0.40.0 |
| 43 | + - name: Get the version |
| 44 | + run: vals version | grep 0.40.0 |
| 45 | + - uses: ./ |
| 46 | + with: |
| 47 | + version: 0.28.0 |
| 48 | + - name: Get the version |
| 49 | + run: vals version | grep 0.28.0 |
| 50 | + |
| 51 | + super-lint: |
| 52 | + name: super-lint |
| 53 | + runs-on: ubuntu-24.04 |
| 54 | + permissions: |
| 55 | + contents: read |
| 56 | + steps: |
| 57 | + - name: Checkout Code |
| 58 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 59 | + with: |
| 60 | + fetch-depth: 0 |
| 61 | + |
| 62 | + - name: Lint Code Base |
| 63 | + uses: super-linter/super-linter/slim@4e8a7c2bf106c4c766c816b35ec612638dc9b6b2 # v7.3.0 |
| 64 | + env: |
| 65 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + MULTI_STATUS: false |
| 67 | + LINTER_RULES_PATH: . |
| 68 | + VALIDATE_ALL_CODEBASE: true |
| 69 | + VALIDATE_BASH: true |
| 70 | + VALIDATE_BASH_EXEC: true |
| 71 | + VALIDATE_ENV: true |
| 72 | + VALIDATE_GITHUB_ACTIONS: true |
| 73 | + VALIDATE_HTML: true |
| 74 | + VALIDATE_NATURAL_LANGUAGE: true |
| 75 | + VALIDATE_SHELL_SHFMT: true |
| 76 | + VALIDATE_XML: true |
| 77 | + VALIDATE_YAML: true |
| 78 | + |
| 79 | + release: |
| 80 | + if: github.repository_owner == 'jkroepke' && github.ref_name == 'main' |
| 81 | + name: Release |
| 82 | + runs-on: ubuntu-latest |
| 83 | + needs: |
| 84 | + - build |
| 85 | + - test |
| 86 | + - super-lint |
| 87 | + permissions: |
| 88 | + contents: write |
| 89 | + steps: |
| 90 | + - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 |
| 91 | + id: app-token |
| 92 | + with: |
| 93 | + app-id: 1248576 |
| 94 | + private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} |
| 95 | + - name: Checkout |
| 96 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 97 | + with: |
| 98 | + fetch-depth: 0 |
| 99 | + - name: Setup Node.js |
| 100 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 101 | + with: |
| 102 | + node-version: '22' |
| 103 | + - name: Install dependencies |
| 104 | + run: npm clean-install |
| 105 | + - name: Release |
| 106 | + env: |
| 107 | + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
| 108 | + run: npx semantic-release |
0 commit comments