|
| 1 | +name: CustomAppModuleMapperCI |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - "**" |
| 6 | +jobs: |
| 7 | + Release_addon: |
| 8 | + runs-on: "ubuntu-latest" |
| 9 | + steps: |
| 10 | + - name: Checkout code |
| 11 | + uses: actions/checkout@v3 |
| 12 | + # The next step is used to fix a small issue here to obtain the current tag message, which will be used as the release body. For more details |
| 13 | + # see https://github.com/actions/checkout/issues/290 |
| 14 | + - name: make sure we have the correct tag information |
| 15 | + run: git fetch --tags --force |
| 16 | + - name: Obtain tag message |
| 17 | + uses: ericcornelissen/git-tag-annotation-action@v2 |
| 18 | + id: tag-data |
| 19 | + - name: Check differences to main branch |
| 20 | + id: differences-to-main |
| 21 | + run: | |
| 22 | + if git diff origin/main --exit-code; then |
| 23 | + echo "::set-output name=changes_exist::false" |
| 24 | + else |
| 25 | + echo "::set-output name=changes_exist::true" |
| 26 | + fi |
| 27 | + - name: abort if tag is not applied on top of main |
| 28 | + if: ${{ steps.differences-to-main.outputs.changes_exist == 'true' }} |
| 29 | + uses: actions/github-script@v3 |
| 30 | + with: |
| 31 | + script: | |
| 32 | + core.setFailed('Releases can be generated only from commit on head of main branch') |
| 33 | + - name: install system dependencies |
| 34 | + run: | |
| 35 | + sudo apt update |
| 36 | + sudo apt install -y gettext |
| 37 | + - name: Install python |
| 38 | + uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + # it seems that x86 versions of python 3 are not available for linux install. |
| 41 | + # In this addon context it is really not important, as packaging should not deppend on architecture versions |
| 42 | + # However, for future NVDA related actions we might have to switch to windows runners |
| 43 | + python-version: "3.11" |
| 44 | + - name: install python dependencies |
| 45 | + run: | |
| 46 | + pip install scons |
| 47 | + pip install markdown |
| 48 | + pip install pre-commit |
| 49 | + - name: validate addon |
| 50 | + run: | |
| 51 | + pre-commit run --all-files |
| 52 | + - name: build addon |
| 53 | + run: | |
| 54 | + rm -f *.nvda-addon || true |
| 55 | + scons |
| 56 | + - name: Release addon |
| 57 | + uses: softprops/action-gh-release@v2 |
| 58 | + with: |
| 59 | + files: "*.nvda-addon" |
| 60 | + body: "${{ steps.tag-data.outputs.git-tag-annotation }}" |
| 61 | + fail_on_unmatched_files: true |
| 62 | + generate_release_notes: false |
0 commit comments