refisi file release.yml #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create NVDA Addon Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Workflow akan berjalan ketika ada push dengan tag yang diawali 'v', misalnya 'v1.0.0' | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: windows-latest | |
| steps: | |
| # Checkout repository | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # Install dependencies | |
| - name: Install Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install scons | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install scons | |
| # Build the addon file using scons | |
| - name: Build Addon | |
| run: | | |
| cd addon | |
| scons | |
| # Create a new release | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: false | |
| # Upload file to release | |
| - name: Upload Addon to Release | |
| id: upload-addon | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./addon/*.nvda-addon # Path file addon kamu setelah build | |
| asset_name: MyCalculator-1.0.0.nvda-addon | |
| asset_content_type: application/octet-stream # Tipe konten untuk file .nvda-addon |