From cd83a82c5840387fa1979803e4d3a75957249209 Mon Sep 17 00:00:00 2001 From: Ben Floyd Date: Wed, 3 Jun 2026 16:25:27 -0600 Subject: [PATCH] add attestations --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++ CONTRIBUTING.md | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..466b0c7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release Obsidian Plugin + +on: + push: + tags: + - "*" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + attestations: write + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: npm ci + + - name: Build plugin + run: npm run build + + - name: Attest build provenance + uses: actions/attest-build-provenance@v2 + with: + subject-path: | + dist/main.js + dist/manifest.json + dist/styles.css + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: | + dist/main.js + dist/manifest.json + dist/styles.css + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..864744c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# Contributing to Streams + +Welcome! We gladly accept contributions from the community. If you'd like to help improve Streams, follow the steps below. + +## How to Contribute + +1. **Fork the repository** and clone it to your local machine. +2. **Install dependencies** by running `npm install`. +3. **Create a new branch** for your feature or bug fix (`git checkout -b feature/your-feature-name`). +4. **Make your changes**. You can use `npm run dev` to watch for changes and compile the plugin, then test them locally in your Obsidian vault. +5. **Commit your changes** with clear, descriptive commit messages. +6. **Push to your fork** and open a Pull Request against our `main` branch. + +All Pull Requests will be reviewed and merged by the maintainer. + +--- + +## Maintainer Guide: Releasing a New Version +*(The following instructions are for project maintainers only)* + +The release process is fully automated via GitHub Actions. **You do not need to build the plugin or generate attestations manually.** + +Whenever a new tag is pushed, a background GitHub Action will automatically: +- **Build the plugin** (`main.js`, `styles.css`) from source. +- **Generate cryptographic artifact attestations** for security and provenance. +- **Publish a GitHub Release** and attach the built artifacts. + +Before triggering a release, **you must bump the version numbers**: +1. Run `npm run version` (or manually update `manifest.json` and `versions.json`). +2. Commit and push the changes to the `main` branch. + +Once the versions are bumped, you can trigger the automated release using either the GitHub UI or the command line. + +### Option 1: Using the GitHub Releases UI (Recommended) +This is the simplest method if you prefer a visual interface. + +1. Navigate to the **Releases** page on your GitHub repository. +2. Click the **Draft a new release** button. +3. In the "Choose a tag" dropdown, type your new version tag (e.g., `1.0.6`) and click **Create new tag: 1.0.6 on publish**. +4. (Optional) Fill out the release title and notes. +5. Click **Publish release**. + +> **Note:** As soon as you click publish, GitHub will trigger the Action in the background. Navigate to the **Actions** tab to watch it build, sign, and attach the files to your newly drafted release! + +### Option 2: Using the Command Line (CLI) +If you prefer terminal commands, you can push the tag directly via Git. + +1. Create a local tag for your new version: + ```bash + git tag 1.0.6 + ``` +2. Push the tag to GitHub: + ```bash + git push origin main --tags + ``` + +> **Note:** Pushing the tag automatically triggers the GitHub Action. The Action will build the assets and create the GitHub Release for you automatically. You can edit the release notes in the GitHub UI afterward if needed.