|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - 'main' |
7 | | - - 'alpha' |
8 | | - - 'beta' |
9 | | - - '*.x' |
10 | | - - '*.*.x' |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + - "alpha" |
| 8 | + - "beta" |
| 9 | + - "*.x" |
| 10 | + - "*.*.x" |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - release: |
14 | | - name: Release |
15 | | - runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - name: Checkout |
18 | | - uses: actions/checkout@v3 |
| 13 | + release: |
| 14 | + name: Release |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v3 |
19 | 19 |
|
20 | | - - uses: actions/setup-node@v3 |
21 | | - with: |
22 | | - node-version: '18.x' |
23 | | - registry-url: 'https://registry.npmjs.org' |
| 20 | + - uses: actions/setup-node@v3 |
| 21 | + with: |
| 22 | + node-version: "18.x" |
| 23 | + registry-url: "https://registry.npmjs.org" |
24 | 24 |
|
25 | | - - run: npm ci |
26 | | - - run: npm run lint |
27 | | - - run: npm run semantic-release-dry-run |
28 | | - env: |
29 | | - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
30 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
31 | | - CI: true |
32 | | - # Grab the tag number by running semantic-release in dry mode and put the result in release_tag env variable |
33 | | - - run: echo "release_tag=$(npm run semantic-release-dry-run | grep -Po 'The next release version is \K([\w.-]*)')" >> $GITHUB_ENV |
34 | | - env: |
35 | | - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
36 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
37 | | - CI: true |
38 | | - - run: npm run test |
39 | | - #- run: sed -i 's|""|"https://cdn.jsdelivr.net/npm/@workadventure/scripting-api-extra@${{ env.release_tag }}/dist"|g' src/Features/default_assets_url.ts |
40 | | - - run: sed -i 's|""|"https://unpkg.com/@workadventure/scripting-api-extra@${{ env.release_tag }}/dist"|g' src/Features/default_assets_url.ts |
41 | | - - run: sed -i 's|""|"https://admin.workadventu.re/html"|g' src/Features/workadventure_assets_url.ts |
42 | | - - run: npm run build --if-present |
| 25 | + - run: npm ci |
| 26 | + - run: npm run lint |
| 27 | + - run: npm run semantic-release-dry-run |
| 28 | + env: |
| 29 | + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 30 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 31 | + CI: true |
| 32 | + # Grab the tag number by running semantic-release in dry mode and put the result in release_tag env variable |
| 33 | + - run: echo "release_tag=$(npm run semantic-release-dry-run | grep -Po 'The next release version is \K([\w.-]*)')" >> $GITHUB_ENV |
| 34 | + env: |
| 35 | + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 36 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 37 | + CI: true |
| 38 | + - run: npm run test |
| 39 | + #- run: sed -i 's|""|"https://cdn.jsdelivr.net/npm/@workadventure/scripting-api-extra@${{ env.release_tag }}/dist"|g' src/Features/default_assets_url.ts |
| 40 | + - run: sed -i 's|""|"https://unpkg.com/@workadventure/scripting-api-extra@${{ env.release_tag }}/dist"|g' src/Features/default_assets_url.ts |
| 41 | + - run: sed -i 's|""|"https://admin.workadventu.re/html"|g' src/Features/workadventure_assets_url.ts |
| 42 | + - run: npm run build --if-present |
43 | 43 |
|
44 | | - # Deployment on Github Pages |
45 | | - - name: "Deploy Github Pages" |
46 | | - uses: JamesIves/github-pages-deploy-action@v4 |
47 | | - if: github.ref == 'refs/heads/main' |
48 | | - with: |
49 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
50 | | - BRANCH: gh-pages # <- Branche sur laquelle seront commités les fichiers |
51 | | - FOLDER: dist/ # <- Dossier contenant notre documentation générée |
52 | | - BASE_BRANCH: main |
| 44 | + # Deployment on Github Pages |
| 45 | + - name: "Deploy Github Pages" |
| 46 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 47 | + if: github.ref == 'refs/heads/main' |
| 48 | + with: |
| 49 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + BRANCH: gh-pages # <- Branche sur laquelle seront commités les fichiers |
| 51 | + FOLDER: dist/ # <- Dossier contenant notre documentation générée |
| 52 | + BASE_BRANCH: main |
53 | 53 |
|
54 | | - # Code coverage |
55 | | - #- name: "Code coverage" |
56 | | - # run: curl -s https://codecov.io/bash | bash |
57 | | - # env: |
58 | | - # CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} |
| 54 | + # Code coverage |
| 55 | + #- name: "Code coverage" |
| 56 | + # run: curl -s https://codecov.io/bash | bash |
| 57 | + # env: |
| 58 | + # CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} |
59 | 59 |
|
60 | | - # Deployment on npm |
61 | | - - name: "Deploy NPM" |
62 | | - run: npm run semantic-release |
63 | | - env: |
64 | | - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
65 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
66 | | - CI: true |
| 60 | + # Deployment on npm |
| 61 | + - name: "Deploy NPM" |
| 62 | + run: npm run semantic-release |
| 63 | + env: |
| 64 | + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 65 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 66 | + CI: true |
0 commit comments