Compile Release #33
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: Compile Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Compile release builds" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.RELEASE_PAT }} | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Verify release tag is on main | |
| if: github.event_name == 'push' | |
| run: | | |
| git fetch origin main:refs/remotes/origin/main | |
| TAG_COMMIT="$(git rev-list -n 1 "$GITHUB_REF_NAME")" | |
| git merge-base --is-ancestor "$TAG_COMMIT" origin/main | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| - name: Cache PlatformIO packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-platformio-${{ hashFiles('platformio.ini', 'platformio.local.example.ini') }} | |
| restore-keys: | | |
| ${{ runner.os }}-platformio- | |
| - name: Install PlatformIO Core | |
| run: uv pip install --system -U https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.19.zip | |
| - name: Resolve release version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| VERSION="${{ inputs.version }}" | |
| else | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| fi | |
| VERSION="${VERSION#v}" | |
| echo "RELEASE_VERSION=$VERSION" >> "$GITHUB_ENV" | |
| sed -i "s/crossink_version = .*/crossink_version = $VERSION/" platformio.ini | |
| - name: Build CrossInk | |
| env: | |
| CROSSPOINT_RELEASE_VERSION: ${{ env.RELEASE_VERSION }} | |
| run: pio run -e teensy -e tiny -e xlarge | |
| - name: Create legacy no_emoji OTA alias | |
| run: | | |
| cp ".pio/build/tiny/firmware-tiny-v${{ env.RELEASE_VERSION }}.bin" \ | |
| ".pio/build/tiny/firmware-no_emoji-v${{ env.RELEASE_VERSION }}.bin" | |
| - name: Generate release catalog | |
| run: | | |
| python3 scripts/generate_release_catalog.py \ | |
| --version "${{ env.RELEASE_VERSION }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --firmware ".pio/build/teensy/firmware-teensy-v${{ env.RELEASE_VERSION }}.bin" \ | |
| --firmware ".pio/build/tiny/firmware-tiny-v${{ env.RELEASE_VERSION }}.bin" \ | |
| --firmware ".pio/build/xlarge/firmware-xlarge-v${{ env.RELEASE_VERSION }}.bin" \ | |
| --output ".pio/build/catalog" | |
| - name: Publish catalog to GitHub Pages source | |
| env: | |
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
| CROSSINK_SIGNING_SSH_KEY: ${{ secrets.CROSSINK_SIGNING_SSH_KEY }} | |
| run: | | |
| if [ -z "$CROSSINK_SIGNING_SSH_KEY" ]; then | |
| echo "::error::CROSSINK_SIGNING_SSH_KEY is not set" | |
| exit 1 | |
| fi | |
| install -m 700 -d ~/.ssh | |
| printf '%s\n' "$CROSSINK_SIGNING_SSH_KEY" > ~/.ssh/crossink_actions_signing | |
| chmod 600 ~/.ssh/crossink_actions_signing | |
| ssh-keygen -y -f ~/.ssh/crossink_actions_signing > ~/.ssh/crossink_actions_signing.pub | |
| git config user.name "uxjulia" | |
| git config user.email "julia@uxj.io" | |
| git config gpg.format ssh | |
| git config user.signingkey "$HOME/.ssh/crossink_actions_signing.pub" | |
| git fetch origin "$DEFAULT_BRANCH" | |
| git worktree add ../crossink-pages "origin/$DEFAULT_BRANCH" | |
| cp ".pio/build/catalog" "../crossink-pages/docs/catalog" | |
| cd ../crossink-pages | |
| if git diff --quiet -- docs/catalog; then | |
| echo "docs/catalog is already current" | |
| exit 0 | |
| fi | |
| git add docs/catalog | |
| git commit -S -m "Update release manifests for v${RELEASE_VERSION}" | |
| git push origin "HEAD:$DEFAULT_BRANCH" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| token: ${{ secrets.RELEASE_PAT }} | |
| tag_name: v${{ env.RELEASE_VERSION }} | |
| target_commitish: ${{ github.sha }} | |
| draft: true | |
| files: | | |
| .pio/build/teensy/firmware-teensy-v${{ env.RELEASE_VERSION }}.bin | |
| .pio/build/tiny/firmware-tiny-v${{ env.RELEASE_VERSION }}.bin | |
| .pio/build/tiny/firmware-no_emoji-v${{ env.RELEASE_VERSION }}.bin | |
| .pio/build/xlarge/firmware-xlarge-v${{ env.RELEASE_VERSION }}.bin |