Connect applications to schemes, filetypes, and more on macOS (more to come)
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

successes!

+45 -126
+4
.config/ci/release/workflows.cue
··· 1 + package release 2 + 3 + // Apply schema validation to all workflows 4 + workflows: [string]: #Workflow
+41 -126
.github/workflows/release.yml
··· 1 - # .github/workflows/release.yml 2 - name: Release 1 + # Code generated by .config/ci/tools.cue; DO NOT EDIT. 3 2 4 - on: 3 + name: Release 4 + "on": 5 5 push: 6 6 tags: 7 - - '*' # Trigger on any tag push 8 - 7 + - '*' 9 8 defaults: 10 9 run: 11 10 shell: bash 12 - 13 11 env: 14 - # Project name used in the justfile for artifact naming 12 + RUSTFLAGS: --deny warnings 15 13 BINARY_NAME: infat 16 - 17 14 jobs: 18 15 prerelease: 19 - # This job determines if the tag is a pre-release based on its format. 20 - # It remains unchanged as it controls the GitHub Release 'prerelease' flag. 21 - runs-on: macos-latest 16 + runs-on: ubuntu-latest 22 17 outputs: 23 18 value: ${{ steps.prerelease.outputs.value }} 24 19 steps: 25 20 - name: Prerelease Check 26 21 id: prerelease 27 22 run: | 28 - # extract just the tag name (e.g. v1.2.3-alpha) 29 23 tag=${GITHUB_REF##*/} 30 - 31 - # if it ends in -alpha or -beta → prerelease 32 24 if [[ "$tag" =~ -(alpha|beta)$ ]]; then 33 25 echo "value=true" >> $GITHUB_OUTPUT 34 26 else 35 27 echo "value=false" >> $GITHUB_OUTPUT 36 28 fi 37 - 38 29 package: 39 - # This job builds and packages the project for various targets using the justfile. 40 30 strategy: 41 - fail-fast: false # Don't cancel other jobs if one fails 31 + fail-fast: false 42 32 matrix: 43 - target: 44 - - arm64-apple-macos 45 - - x86_64-apple-macos 33 + taret: 34 + - aarch64-apple-darwin 35 + - x86_64-apple-darwin 46 36 include: 47 - # Define OS and specific flags for cross-compilation targets 48 - - target: arm64-apple-macos 37 + - target: aarch64-apple-darwin 49 38 os: macos-latest 50 - target_flags: '' 51 - - target: x86_64-apple-macos 39 + - target: x86_64-apple-darwin 52 40 os: macos-latest 53 - target_flags: '' 54 - 55 41 runs-on: ${{ matrix.os }} 56 42 needs: 57 - - prerelease # Wait for prerelease check 58 - 43 + - prerelease 59 44 environment: 60 45 name: main 61 - 62 46 steps: 63 47 - name: Checkout code 64 48 uses: actions/checkout@v4 65 - 66 - # Cache the Swift Package Manager cache 67 - - name: Cache Swift Package Manager 68 - uses: actions/cache@v3 49 + - name: Install Nix 50 + uses: cachix/install-nix-action@v27 69 51 with: 70 - path: | 71 - ~/.swiftpm 72 - key: ${{ runner.os }}-swiftpm-${{ hashFiles('**/Package.swift') }} 73 - restore-keys: | 74 - ${{ runner.os }}-swiftpm- 75 - 76 - - name: Set up Swift toolchain 77 - uses: swift-actions/setup-swift@v2 52 + extra_nix_config: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 53 + - name: Cache Cargo registry and git 54 + uses: actions/cache@v4 78 55 with: 79 - swift-version: "6.1.0" 80 - 81 - - name: Install Just (Command Runner) 82 - run: | 83 - set -euxo pipefail 84 - 85 - # Using || true to prevent failure if package isn't found to catch on fallback 86 - # Try installing via native package manager first 87 - if [[ "$RUNNER_OS" == "Linux" ]]; then 88 - echo "Attempting to install just via apt..." 89 - sudo apt-get update -y 90 - sudo apt-get install -y just || echo "apt install failed or package not found." 91 - elif [[ "$RUNNER_OS" == "macOS" ]]; then 92 - echo "Attempting to install just via Homebrew..." 93 - brew install just || echo "brew install failed." 94 - elif [[ "$RUNNER_OS" == "Windows" ]]; then 95 - echo "Attempting to install just via Chocolatey..." 96 - choco install just --yes || echo "choco install failed." 97 - else 98 - echo "Unsupported OS for package manager installation: $RUNNER_OS." 99 - fi 100 - 101 - # Fallback to cargo install if 'just' command is not found after package manager attempt 102 - if ! command -v just &>/dev/null; then 103 - echo "Just not found after package manager attempt. Installing via cargo install..." 104 - cargo install just 105 - else 106 - echo "Just installed successfully via package manager or was already present." 107 - fi 108 - 109 - # --- Build using Just --- 110 - - name: Build the release version 111 - # Set flags combining global and target-specific flags for swift build inside just 112 - env: 113 - SWIFT_FLAGS: ${{ matrix.target_flags }} 114 - # Run the just recipe, passing the target from the matrix, outputs to "dist/" 115 - run: just package ${{ matrix.target }} 116 - 117 - - name: Compress the binaries 118 - run: just compress-binaries "dist/" 119 - 120 - # --- Publish Artifact --- 121 - - name: Determine Artifact Name 122 - id: artifact_name 123 - run: | 124 - ARTIFACT_PATH="dist/${{ env.BINARY_NAME }}-${{ matrix.target }}" 125 - # Get the archived version 126 - echo "path=${ARTIFACT_PATH}.tar.gz" >> $GITHUB_OUTPUT 127 - 56 + path: |- 57 + ~/.cargo/registry/index 58 + ~/.cargo/registry/cache 59 + ~/.cargo/git/db 60 + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} 61 + restore-keys: ${{ runner.os }}-cargo-registry- 62 + - name: Build and Package 63 + run: nix develop --command just package ${{ matrix.target }} 128 64 - name: Extract changelog for the tag 129 - id: extract_changelog 130 - run: just create-notes ${{ github.ref_name }} release_notes.md CHANGELOG.md 131 - 65 + run: nix develop --command just create-notes ${{ github.ref_name }} release_notes.md CHANGELOG.md 132 66 - name: Publish Release 133 67 uses: softprops/action-gh-release@v2 134 68 if: startsWith(github.ref, 'refs/tags/') 135 69 with: 136 - files: ${{ steps.artifact_name.outputs.path }} 70 + files: dist/${{ env.BINARY_NAME }}-${{ matrix.target }}.tar.gz 137 71 body_path: release_notes.md 138 72 draft: false 139 - overwrite: true 73 + make_latest: true 140 74 prerelease: ${{ needs.prerelease.outputs.value }} 141 - make_latest: true 142 75 token: ${{ secrets.PAT }} 143 - 144 76 checksum: 145 - # This job downloads all published artifacts and creates a checksum file. 146 77 runs-on: ubuntu-latest 147 78 needs: 148 - - package # Wait for all package jobs to potentially complete 79 + - package 149 80 - prerelease 150 - # Only run for tag pushes 151 81 if: startsWith(github.ref, 'refs/tags/') 152 - 153 82 environment: 154 83 name: main 155 - 156 84 steps: 157 - - name: Install GitHub CLI 158 - run: sudo apt-get update && sudo apt-get install -y gh 159 - 85 + - name: Install Nix 86 + uses: cachix/install-nix-action@v27 87 + with: 88 + extra_nix_config: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 160 89 - name: Download Release Archives 161 90 env: 162 - # Use PAT for gh CLI authentication 163 91 GH_TOKEN: ${{ secrets.PAT }} 164 - # Get the tag name from the ref 165 92 TAG_NAME: ${{ github.ref_name }} 166 - run: | 167 - gh release download "$TAG_NAME" \ 93 + run: |- 94 + nix develop --command gh release download "$TAG_NAME" \ 168 95 --repo "$GITHUB_REPOSITORY" \ 169 96 --pattern '*' \ 170 - --dir release 171 - 172 - - name: Create Checksums 173 - run: | 174 - find release/ -type f \ 175 - ! -name "checksums.sha256" \ 176 - ! -name "README*" \ 177 - ! -name "*.sha256" \ 178 - -print0 \ 179 - | while IFS= read -r -d '' file; do 180 - sha256sum "$file" > "$file.sha256" 181 - done 182 - 183 - 184 - - name: Publish Individual Checksums 97 + --dir dist 98 + - name: Generate Checksums 99 + run: nix develop --command just checksum dist 100 + - name: Publish Checksums 185 101 uses: softprops/action-gh-release@v2 186 102 with: 187 - # Use a wildcard to upload all generated .sha256 files from the release dir 188 - files: release/*.sha256 103 + files: dist/*.sum 189 104 draft: false 190 105 prerelease: ${{ needs.prerelease.outputs.value }} 191 106 token: ${{ secrets.PAT }}