Fix leftover merge marker in SFTP state #3
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: build-packages | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| publish_release: | |
| description: "Publish GitHub Release after build" | |
| type: boolean | |
| default: false | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: build-${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| env: | |
| VITE_SYNC_GITHUB_CLIENT_ID: ${{ secrets.VITE_SYNC_GITHUB_CLIENT_ID }} | |
| VITE_SYNC_GOOGLE_CLIENT_ID: ${{ secrets.VITE_SYNC_GOOGLE_CLIENT_ID }} | |
| VITE_SYNC_GOOGLE_CLIENT_SECRET: ${{ secrets.VITE_SYNC_GOOGLE_CLIENT_SECRET }} | |
| VITE_SYNC_ONEDRIVE_CLIENT_ID: ${{ secrets.VITE_SYNC_ONEDRIVE_CLIENT_ID }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install deps | |
| run: npm ci | |
| - name: Set version from tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| shell: bash | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "Setting version to ${VERSION}" | |
| npm pkg set version="${VERSION}" | |
| - name: Build package (macOS) | |
| if: matrix.os == 'macos-latest' | |
| env: | |
| CSC_IDENTITY_AUTO_DISCOVERY: "false" | |
| ELECTRON_BUILDER_PUBLISH: "never" | |
| run: npm run pack:mac | |
| - name: Build package (Windows) | |
| if: matrix.os == 'windows-latest' | |
| env: | |
| ELECTRON_BUILDER_PUBLISH: "never" | |
| run: npm run pack:win | |
| - name: Build package (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| env: | |
| ELECTRON_BUILDER_PUBLISH: "never" | |
| run: npm run pack:linux | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: netcatty-${{ matrix.os }} | |
| path: | | |
| release/*.dmg | |
| release/*.zip | |
| release/*.exe | |
| release/*.msi | |
| release/*.AppImage | |
| release/*.deb | |
| release/*.rpm | |
| release/*.tar.gz | |
| release/*.blockmap | |
| release/latest*.yml | |
| if-no-files-found: ignore | |
| release: | |
| name: release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish_release) || (github.event_name == 'push' && github.ref == 'refs/heads/main') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -la artifacts/ | |
| - name: Compute release tag | |
| id: release_tag | |
| if: "!startsWith(github.ref, 'refs/tags/')" | |
| shell: bash | |
| run: | | |
| TS="$(date -u +'%Y%m%d-%H%M')" | |
| SHORT_SHA="${GITHUB_SHA::7}" | |
| echo "tag=dev-${TS}-${SHORT_SHA}" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.release_tag.outputs.tag || github.ref_name }} | |
| name: ${{ steps.release_tag.outputs.tag || github.ref_name }} | |
| prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| files: | | |
| artifacts/*.dmg | |
| artifacts/*.zip | |
| artifacts/*.exe | |
| artifacts/*.msi | |
| artifacts/*.AppImage | |
| artifacts/*.deb | |
| artifacts/*.rpm | |
| artifacts/*.tar.gz | |
| artifacts/*.blockmap | |
| artifacts/latest*.yml | |
| generate_release_notes: true | |
| fail_on_unmatched_files: false | |
| token: ${{ secrets.RELEASE_TOKEN }} |