feat: add button to open settings directory from U #93
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: Release | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version' | |
| required: true | |
| type: string | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check-version: | |
| name: Check Version & Tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| created: ${{ steps.check_tag.outputs.created }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust Toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Get version from Cargo.toml | |
| id: get_version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| echo "Using manually provided version: $VERSION" | |
| else | |
| VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') | |
| echo "Detected version from Cargo.toml: $VERSION" | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Check if tag exists | |
| id: check_tag | |
| run: | | |
| if git ls-remote --exit-code --tags origin "v${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then | |
| echo "Tag v${{ steps.get_version.outputs.version }} already exists. Skipping release." | |
| echo "created=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Tag v${{ steps.get_version.outputs.version }} does not exist. Proceeding with release." | |
| echo "created=true" >> $GITHUB_OUTPUT | |
| fi | |
| build: | |
| name: Build (${{ matrix.os-name }}) | |
| needs: check-version | |
| if: needs.check-version.outputs.created == 'true' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| os-name: Windows | |
| target: x86_64-pc-windows-msvc | |
| binary: sen.exe | |
| artifact: sen-v${{ needs.check-version.outputs.version }}-windows.exe | |
| - os: ubuntu-latest | |
| os-name: Linux | |
| target: x86_64-unknown-linux-gnu | |
| binary: sen | |
| artifact: sen-v${{ needs.check-version.outputs.version }}-linux | |
| - os: macos-latest | |
| os-name: macOS | |
| target: x86_64-apple-darwin | |
| binary: sen | |
| artifact: sen-v${{ needs.check-version.outputs.version }}-macos | |
| - os: macos-latest | |
| os-name: macOS ARM64 | |
| target: aarch64-apple-darwin | |
| binary: sen | |
| artifact: sen-v${{ needs.check-version.outputs.version }}-macos-arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Setup Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "." | |
| key: ${{ matrix.target }} | |
| cache-targets: false | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libfontconfig1-dev \ | |
| libfreetype6-dev \ | |
| libx11-dev \ | |
| libxext-dev \ | |
| libxrender-dev \ | |
| libxcb1-dev \ | |
| libxcb-render0-dev \ | |
| libxcb-shape0-dev \ | |
| libxcb-xfixes0-dev \ | |
| libwayland-dev \ | |
| libxkbcommon-dev \ | |
| pkg-config | |
| - name: Build Release Binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Rename Binary | |
| run: mv target/${{ matrix.target }}/release/${{ matrix.binary }} target/${{ matrix.target }}/release/${{ matrix.artifact }} | |
| shell: bash | |
| - name: Generate Checksum | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| sha256sum ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256 | |
| shell: bash | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.target }} | |
| path: | | |
| target/${{ matrix.target }}/release/${{ matrix.artifact }} | |
| target/${{ matrix.target }}/release/${{ matrix.artifact }}.sha256 | |
| retention-days: 1 | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [check-version, build] | |
| if: needs.check-version.outputs.created == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release_files | |
| pattern: binaries-* | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.check-version.outputs.version }} | |
| name: v${{ needs.check-version.outputs.version }} | |
| files: release_files/* | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| token: ${{ secrets.RELEASE_PAT }} |