From a4b07f5e81ea6b19d4ce2456bdbb81590c32e56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noelia=20Ruiz=20Mart=C3=ADnez?= Date: Wed, 22 Feb 2023 18:14:57 +0100 Subject: [PATCH] Update auxiliar files --- .github/workflows/manualRelease.yaml | 100 +++++++++++++++++++++------ .vscode/extensions.json | 12 ++++ .vscode/settings.json | 35 ++++++++++ 3 files changed, 126 insertions(+), 21 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.github/workflows/manualRelease.yaml b/.github/workflows/manualRelease.yaml index d150311..1981f2e 100644 --- a/.github/workflows/manualRelease.yaml +++ b/.github/workflows/manualRelease.yaml @@ -3,23 +3,47 @@ name: Manual release on: workflow_dispatch: inputs: - version: + version: description: 'Add-on version' required: true default: '0.0.0' prerelease: - description: 'True if this is a prerelease' + description: 'Mark as prerelease on GitHub' + default: false type: boolean - required: false + signAddOn: + description: 'Sign add-on with GPG' default: false + type: boolean + publishOnStore: + description: 'Publish on add-on datastore' + default: true + type: boolean + channel: + description: 'Add-on channel for store' + default: stable + type: choice + options: + - stable + - beta + license: + description: 'Add-on license' + default: 'GPL v2' + licenseURL: + description: 'Add-on license URL' + default: 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.html' + jobs: buildAndUpload: + continue-on-error: true runs-on: ubuntu-latest + steps: - - name: Checkout code + - id: checkoutCode + name: Checkout code uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: 3.8 - name: Install dependencies @@ -38,34 +62,68 @@ jobs: f.write(text) f.truncate() shell: python + - name: Build add-on + run: scons - name: Push changes run: | git config --global user.name github-actions git config --global user.email github-actions@github.com git commit -a -m "Update buildVars" git push origin HEAD:main - - name: Build add-on - run: scons - - name: Import GPG key - id: import_gpg + - id: import_gpg + if: ${{ inputs.signAddOn }} + name: Import GPG key uses: crazy-max/ghaction-import-gpg@v5 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.PASSPHRASE }} - - name: Sign add-on + - if: ${{ inputs.signAddOn }} + name: Sign add-on run: gpg --detach-sign *.nvda-addon - name: Calculate sha256 run: sha256sum *.nvda-addon >> sha256.txt + - name: Create tag + run: | + git tag ${{ inputs.version }} + git push origin ${{ inputs.version }} - name: Release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ncipollo/release-action@v1 + with: + tag: ${{ inputs.version }} + artifacts: "*.nvda-addon,*.sig,publicKey.asc,sha256.txt" + generateReleaseNotes: true + prerelease: ${{ inputs.prerelease }} + + store: + needs: buildAndUpload + if: ${{ inputs.publishOnStore }} + runs-on: windows-latest + + steps: + - name: Checkout validation repo + uses: actions/checkout@v3 + with: + repository: nvaccess/addon-datastore-validation + submodules: true + path: validation + - name: Checkout datastore repo + uses: actions/checkout@v3 + with: + repository: nvaccess/addon-datastore + path: store + - name: Download add-on + run: | + curl --location --output addon.nvda-addon ${{ github.event.repository.html_url }}/releases/download/${{ inputs.version }}/${{ github.event.repository.name }}-${{ inputs.version }}.nvda-addon + - name: Create json + run: | + validation\runcreatejson -f addon.nvda-addon --dir store\addons --channel=${{ inputs.channel }} --publisher=${{ github.event.sender.login }} --sourceUrl=${{ github.event.repository.html_url }}/ --url=${{ github.event.repository.html_url }}/releases/download/${{ inputs.version }}/${{ github.event.repository.name }}-${{ inputs.version }}.nvda-addon --licName="${{ inputs.license }}" --licUrl=${{ inputs.licenseURL }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 with: - tag_name: ${{ github.event.inputs.version }} - files: | - *.nvda-addon - *.sig - publicKey.asc - sha256.txt - generate_release_notes: true - prerelease: ${{ github.event.inputs.prerelease }} + token: ${{ secrets.PR_ACCESS_TOKEN }} + path: store + commit-message: Add ${{ github.event.repository.name }} ${{ inputs.version }} add-on + branch: ${{ github.event.repository.name}}-${{ inputs.version }} + delete-branch: true + title: Add ${{ github.event.repository.name }} ${{ inputs.version }} add-on + push-to-fork: ${{ github.event.sender.login }}/addon-datastore diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..75fa7aa --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,12 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "ms-python.python", + "ms-python.vscode-pylance", + "redhat.vscode-yaml" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cd00ed8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,35 @@ +{ + "editor.accessibilitySupport": "on", + "python.linting.enabled": true, + "python.linting.maxNumberOfProblems": 10000, + "python.linting.flake8Args": [ + "--config=flake8.ini" + ], + "python.linting.flake8Enabled": true, + "python.linting.pylintEnabled": false, + "python.autoComplete.extraPaths": [ + "../nvda/source", + "../nvda/miscDeps/python" + ], + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "editor.insertSpaces": false, + "python.testing.unittestArgs": [ + "-v", + "-s", + "tests", + "-p", + "test_*.py" + ], + "python.testing.pytestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.unittestEnabled": true, + "python.analysis.diagnosticSeverityOverrides": { + "reportUndefinedVariable": "none" + }, + "python.analysis.extraPaths": [ + "../nvda/source", + "../nvda/miscDeps/python" + ], + "python.defaultInterpreterPath": "../nvda/.venv/scripts/python.exe" +}