A CLI for publishing standard.site documents to ATProto
at main 101 lines 3.1 kB view raw
1name: 'Remanso Publish' 2description: 'Publish your .pub.md notes to ATProtocol using Remanso CLI' 3branding: 4 icon: 'upload-cloud' 5 color: 'green' 6 7inputs: 8 identifier: 9 description: 'ATProto handle or DID (e.g. yourname.bsky.social)' 10 required: true 11 app-password: 12 description: 'ATProto app password' 13 required: true 14 pds-url: 15 description: 'PDS URL (defaults to https://bsky.social)' 16 required: false 17 default: 'https://bsky.social' 18 force: 19 description: 'Force publish all notes, ignoring change detection' 20 required: false 21 default: 'false' 22 commit-back: 23 description: 'Commit updated frontmatter back to the repo' 24 required: false 25 default: 'true' 26 working-directory: 27 description: 'Directory containing remanso.json (defaults to repo root)' 28 required: false 29 default: '.' 30 31runs: 32 using: 'composite' 33 steps: 34 - name: Setup Bun 35 uses: oven-sh/setup-bun@v2 36 37 - name: Cache dependencies 38 id: deps-cache 39 uses: actions/cache@v4 40 with: 41 path: ${{ github.action_path }}/node_modules 42 key: remanso-deps-${{ runner.os }}-${{ hashFiles(format('{0}/bun.lock', github.action_path)) }} 43 44 - name: Install dependencies 45 if: steps.deps-cache.outputs.cache-hit != 'true' 46 shell: bash 47 run: cd ${{ github.action_path }} && bun install 48 49 - name: Cache build artifacts 50 id: build-cache 51 uses: actions/cache@v4 52 with: 53 path: ${{ github.action_path }}/packages/remanso/dist 54 key: remanso-build-${{ runner.os }}-${{ hashFiles(format('{0}/bun.lock', github.action_path), format('{0}/packages/remanso/src/**', github.action_path)) }} 55 56 - name: Build CLI 57 if: steps.build-cache.outputs.cache-hit != 'true' 58 shell: bash 59 run: cd ${{ github.action_path }} && bun run build:remanso 60 61 - name: Link CLI 62 shell: bash 63 run: cd ${{ github.action_path }} && bun link --cwd packages/remanso 64 65 - name: Sync state from ATProtocol 66 shell: bash 67 working-directory: ${{ inputs.working-directory }} 68 env: 69 ATP_IDENTIFIER: ${{ inputs.identifier }} 70 ATP_APP_PASSWORD: ${{ inputs.app-password }} 71 PDS_URL: ${{ inputs.pds-url }} 72 run: remanso sync 73 74 - name: Publish 75 shell: bash 76 working-directory: ${{ inputs.working-directory }} 77 env: 78 ATP_IDENTIFIER: ${{ inputs.identifier }} 79 ATP_APP_PASSWORD: ${{ inputs.app-password }} 80 PDS_URL: ${{ inputs.pds-url }} 81 run: | 82 FLAGS="" 83 if [ "${{ inputs.force }}" = "true" ]; then 84 FLAGS="--force" 85 fi 86 remanso publish $FLAGS 87 88 - name: Commit back changes 89 if: inputs.commit-back == 'true' 90 shell: bash 91 working-directory: ${{ inputs.working-directory }} 92 run: | 93 git config user.name "$(git log -1 --format='%an')" 94 git config user.email "$(git log -1 --format='%ae')" 95 git add -A -- '**/*.pub.md' || true 96 if git diff --cached --quiet; then 97 echo "No changes to commit" 98 else 99 git commit -m "chore: update remanso state [skip ci]" 100 git push 101 fi