|
| 1 | +name: Upload Package on Release |
| 2 | + |
| 3 | +# Cancels all previous workflow runs for pull requests that have not completed. |
| 4 | +concurrency: |
| 5 | + # The concurrency group contains the workflow name and the branch name for pull requests |
| 6 | + # or the commit hash for any other events. |
| 7 | + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} |
| 8 | + cancel-in-progress: true |
| 9 | + |
| 10 | +on: |
| 11 | + release: |
| 12 | + types: [published] |
| 13 | + |
| 14 | +jobs: |
| 15 | + tag: |
| 16 | + name: Upload New Release |
| 17 | + runs-on: ubuntu-24.04 |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 22 | + with: |
| 23 | + show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} |
| 24 | + persist-credentials: false |
| 25 | + |
| 26 | + - name: Set up PHP |
| 27 | + uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0 |
| 28 | + with: |
| 29 | + php-version: '8.3' |
| 30 | + coverage: none |
| 31 | + tools: composer:v2 |
| 32 | + |
| 33 | + - name: Install Composer dependencies |
| 34 | + uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0 |
| 35 | + |
| 36 | + - name: Setup Node |
| 37 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 38 | + with: |
| 39 | + cache: 'npm' |
| 40 | + node-version-file: '.nvmrc' |
| 41 | + |
| 42 | + - name: Install NPM dependencies |
| 43 | + run: npm ci |
| 44 | + env: |
| 45 | + CI: true |
| 46 | + |
| 47 | + - name: Create Artifact |
| 48 | + run: | |
| 49 | + npm run plugin-zip |
| 50 | +
|
| 51 | + - name: Upload artifact |
| 52 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 53 | + with: |
| 54 | + name: abilities-api |
| 55 | + path: abilities-api.zip |
| 56 | + |
| 57 | + - name: Upload release asset |
| 58 | + uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2 |
| 59 | + with: |
| 60 | + files: abilities-api.zip |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments