Release #26
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| npm ci | |
| echo "$PWD/node_modules/.bin" >> $GITHUB_PATH | |
| - name: Build WASM | |
| run: make wasm | |
| - name: Run tests | |
| run: go test -v ./... | |
| - name: Get Playwright version | |
| id: playwright-version | |
| run: echo "version=$(npm ls @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }} | |
| - name: Install Playwright Browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install --with-deps | |
| - name: Install Playwright OS dependencies | |
| if: steps.playwright-cache.outputs.cache-hit == 'true' | |
| run: npx playwright install-deps | |
| - name: Test tlock integration | |
| run: make test-tlock | |
| - name: Build binaries | |
| run: make build-all | |
| - name: Generate standalone HTML files | |
| run: | | |
| ./dist/rememory-linux-amd64 html create > dist/maker.html | |
| ./dist/rememory-linux-amd64 html recover > dist/recover.html | |
| - name: Generate demo bundles | |
| run: | | |
| ./dist/rememory-linux-amd64 demo demo | |
| cd demo/output/bundles | |
| zip -r ../../../dist/demo-bundles.zip *.zip | |
| - name: Create checksums | |
| run: | | |
| cd dist | |
| sha256sum * > checksums.txt | |
| - name: Generate Homebrew formula | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| VERSION_NUM="${VERSION#v}" | |
| SHA_DARWIN_ARM64=$(grep 'rememory-darwin-arm64$' dist/checksums.txt | awk '{print $1}') | |
| SHA_DARWIN_AMD64=$(grep 'rememory-darwin-amd64$' dist/checksums.txt | awk '{print $1}') | |
| SHA_LINUX_ARM64=$(grep 'rememory-linux-arm64$' dist/checksums.txt | awk '{print $1}') | |
| SHA_LINUX_AMD64=$(grep 'rememory-linux-amd64$' dist/checksums.txt | awk '{print $1}') | |
| cat > dist/rememory.rb << FORMULA | |
| class Rememory < Formula | |
| desc "A digital safe with multiple keys, held by people you trust" | |
| homepage "https://github.com/eljojo/rememory" | |
| version "${VERSION_NUM}" | |
| license "Apache-2.0" | |
| on_macos do | |
| on_arm do | |
| url "https://github.com/eljojo/rememory/releases/download/${VERSION}/rememory-darwin-arm64" | |
| sha256 "${SHA_DARWIN_ARM64}" | |
| end | |
| on_intel do | |
| url "https://github.com/eljojo/rememory/releases/download/${VERSION}/rememory-darwin-amd64" | |
| sha256 "${SHA_DARWIN_AMD64}" | |
| end | |
| end | |
| on_linux do | |
| on_arm do | |
| url "https://github.com/eljojo/rememory/releases/download/${VERSION}/rememory-linux-arm64" | |
| sha256 "${SHA_LINUX_ARM64}" | |
| end | |
| on_intel do | |
| url "https://github.com/eljojo/rememory/releases/download/${VERSION}/rememory-linux-amd64" | |
| sha256 "${SHA_LINUX_AMD64}" | |
| end | |
| end | |
| def install | |
| bin.install Dir.glob("rememory-*").first => "rememory" | |
| end | |
| test do | |
| assert_match version.to_s, shell_output("#{bin}/rememory --version") | |
| end | |
| end | |
| FORMULA | |
| - name: Upload dist artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist/ | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-25.11 | |
| - name: Build Docker images (amd64 + arm64) | |
| run: | | |
| nix build .#docker -o result-amd64 | |
| nix build .#docker-arm64 -o result-arm64 | |
| - name: Load Docker images | |
| run: | | |
| docker load < result-amd64 | |
| docker load < result-arm64 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push multi-arch Docker images | |
| run: | | |
| IMAGE="ghcr.io/${{ github.repository }}" | |
| VERSION="${{ github.ref_name }}" | |
| # Push architecture-specific images | |
| docker tag rememory:latest "${IMAGE}:${VERSION}-amd64" | |
| docker push "${IMAGE}:${VERSION}-amd64" | |
| docker tag rememory:latest-arm64 "${IMAGE}:${VERSION}-arm64" | |
| docker push "${IMAGE}:${VERSION}-arm64" | |
| # Create and push multi-arch manifests | |
| docker manifest create "${IMAGE}:${VERSION}" \ | |
| "${IMAGE}:${VERSION}-amd64" \ | |
| "${IMAGE}:${VERSION}-arm64" | |
| docker manifest push "${IMAGE}:${VERSION}" | |
| docker manifest create "${IMAGE}:latest" \ | |
| "${IMAGE}:${VERSION}-amd64" \ | |
| "${IMAGE}:${VERSION}-arm64" | |
| docker manifest push "${IMAGE}:latest" | |
| release: | |
| needs: [test, docker] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Create Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Create draft release with assets (drafts can be modified) | |
| gh release create ${{ github.ref_name }} \ | |
| dist/rememory-linux-amd64 \ | |
| dist/rememory-linux-arm64 \ | |
| dist/rememory-darwin-amd64 \ | |
| dist/rememory-darwin-arm64 \ | |
| dist/rememory-windows-amd64.exe \ | |
| dist/demo-bundles.zip \ | |
| dist/checksums.txt \ | |
| dist/maker.html \ | |
| dist/recover.html \ | |
| dist/rememory.rb \ | |
| --generate-notes \ | |
| --notes "**You can use ReMemory without installing anything.** Download \`maker.html\` from the assets below, save it to your desktop, and open it in any browser to create bundles." \ | |
| --draft | |
| # Publish the release (now it becomes immutable) | |
| gh release edit ${{ github.ref_name }} --draft=false | |
| - name: Update Homebrew tap | |
| env: | |
| TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| run: | | |
| git clone https://x-access-token:${TAP_TOKEN}@github.com/eljojo/homebrew-rememory.git /tmp/tap | |
| mkdir -p /tmp/tap/Formula | |
| cp dist/rememory.rb /tmp/tap/Formula/rememory.rb | |
| cd /tmp/tap | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Formula/rememory.rb | |
| git commit -m "Update rememory to ${{ github.ref_name }}" | |
| git push |