[
  {
    "path": ".bump/.state/latestRelease",
    "content": ""
  },
  {
    "path": ".bump/.terraform.lock.hcl",
    "content": "# This file is maintained automatically by \"terraform init\".\n# Manual edits may be lost in future updates.\n\nprovider \"registry.terraform.io/hashicorp/aws\" {\n  version     = \"3.30.0\"\n  constraints = \"3.30.0\"\n  hashes = [\n    \"h1:z9kdXY2A/+dIZrPy9hNlg/B5I/AuETQsp0jz9EgprIQ=\",\n    \"zh:01f562a6a31fe46a8ca74804f360e3452b26f71abc549ce1f0ab5a8af2484cdf\",\n    \"zh:25bacc5ed725051f0ab1f7d575e45c901e5b8e1d50da4156a31dda92b2b7e481\",\n    \"zh:349b79979d9169db614d8ebd1bc2e0caeb7a38dc816e261b8b2b4b5204615519\",\n    \"zh:5e41446acc54c6fc15e82c3fa14b72174b30eba81e0711ede297e5620c55a628\",\n    \"zh:68ad98f6d612bdc35a65d48950abc8e75c69decb49db28258ce8eeb5458586b7\",\n    \"zh:704603d65e8bac17d203b57c2db142c3134a91076e1b4a31c40f75eb3257dde8\",\n    \"zh:a362c700032b2db047d16007d52f28b3f216d32671b6b355d23bdaa082c66a4b\",\n    \"zh:bd197797b41268de3c93cad02b7c655dc0c4d8661abb37544ca049e6b1eccae6\",\n    \"zh:deb12ef0e3396a71d485977ddc14b695775f7937097ebf2b2f53ed348a4365e7\",\n    \"zh:ec8a7d0f02738f290107d39bf401d68ddce82a95cd9d998003f7e04b3a196411\",\n    \"zh:ffcc43b6c5e7f26c55e2a8c539d7370fca8042722400a3e06bdce4240bd7088a\",\n  ]\n}\n"
  },
  {
    "path": ".bump/bin/nuke",
    "content": "#!/bin/bash\n\n# This script nukes the history of any use of Bump\n# Use wisely!\n\nrm -rf ./.bump/terraform.tfstate\nrm -rf ./.bump/terraform.tfstate.backup\nrm -rf ./release/changelog.xml\nrm -rf ./.bump/.state/latestRelease\nrm -rf ./release/AppExample.zip\n\ntouch ./.bump/.state/latestRelease\n\ncat <<EOF > ./release/latest.md\n---\nversion: \"1.0\"\n---\n\nHello World\nEOF\n\ncat <<EOF > config.yml\napp_name: AppExample \napp_filename: AppExample.zip # Should match exactly the .zip file found in ./release/\ns3_bucket_name: app-example-distribution # Must be unique\n\n# More variables need to be added to your environment. See the readme\nEOF\n"
  },
  {
    "path": ".bump/main.tf",
    "content": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"3.30.0\"\n    }\n  }\n}\n\n# Don't put credentials here, instead export them as\n# AWS_ACCESS_KEY and AWS_SECRET_KEY\nprovider \"aws\" {\n  region = \"us-east-1\"\n}\n\nlocals {\n  changelog_filename = \"changelog.xml\"\n  changelog_api_filename = \"changelog.json\"\n  s3_bucket_name = yamldecode(file(\"../config.yml\"))[\"s3_bucket_name\"]\n  app_filename = yamldecode(file(\"../config.yml\"))[\"app_filename\"]\n  app_version = yamldecode(file(\".state/latestRelease\"))[\"version\"]\n}\n\n# Start creating resources\n# To deprovision resources in the future, remove everything below this commment and run `terraform apply`\nresource \"aws_s3_bucket\" \"bucket\" {\n  bucket = local.s3_bucket_name\n  acl    = \"private\"\n\n  cors_rule {\n    allowed_headers = [\"*\"]\n    allowed_methods = [\"GET\"]\n    allowed_origins = [\"*\"]\n    expose_headers  = [\"ETag\"]\n    max_age_seconds = 3000\n  }\n}\n\nresource \"aws_s3_bucket_object\" \"changelog\" {\n  bucket = local.s3_bucket_name\n  key    = local.changelog_filename\n  source = \"../release/${local.changelog_filename}\"\n  etag   = filemd5(\"../release/${local.changelog_filename}\")\n  acl    = \"public-read\"\n  content_type = \"application/xml\"\n\n  depends_on = [\n    aws_s3_bucket.bucket,\n  ]\n}\n\nresource \"aws_s3_bucket_object\" \"changelog_api\" {\n  bucket = local.s3_bucket_name\n  key    = local.changelog_api_filename\n  source = \"../release/${local.changelog_api_filename}\"\n  etag   = filemd5(\"../release/${local.changelog_api_filename}\")\n  acl    = \"public-read\"\n  content_type = \"application/json\"\n\n  depends_on = [\n    aws_s3_bucket.bucket,\n  ]\n}\n\nresource \"aws_s3_bucket_object\" \"versioned_zip\" {\n  bucket = local.s3_bucket_name\n  key    = \"${replace(local.app_version, \".\", \"-\")}/${local.app_filename}\"\n  source = \"../release/${local.app_filename}\"\n  etag   = filemd5(\"../release/${local.app_filename}\")\n  acl    = \"public-read\"\n  content_type = \"application/octet-stream\"\n\n  depends_on = [\n    aws_s3_bucket.bucket,\n  ]\n}\n\nresource \"aws_s3_bucket_object\" \"latest_zip\" {\n  bucket = local.s3_bucket_name\n  key    = \"latest/${local.app_filename}\"\n  source = \"../release/${local.app_filename}\"\n  etag   = filemd5(\"../release/${local.app_filename}\")\n  acl    = \"public-read\"\n  content_type = \"application/octet-stream\"\n\n  depends_on = [\n    aws_s3_bucket.bucket,\n  ]\n}\n\noutput \"changelog_public_url\" {\n  description = \"The URL for the changelog.xml file\"\n  value       = \"https://${aws_s3_bucket.bucket.bucket_domain_name}/${local.changelog_filename}\"\n}\n"
  },
  {
    "path": ".github/workflows/main.yml",
    "content": "name: Create Release\n\non:\n  push:\n    paths:\n    - 'release/latest.md'\n\n  workflow_dispatch:\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      \n      - name: Create changelog\n        env:\n          SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}\n        run: ./.bump/bin/bump\n\n      - name: Commit changes\n        uses: EndBug/add-and-commit@v7\n        with:\n          message: 'Create release changelog'\n          add: '*.xml'\n\n      - uses: hashicorp/setup-terraform@v1\n        if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'\n\n      - name: Setup Terraform\n        run: terraform init\n        working-directory: ./.bump/\n        if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'\n\n      - name: Apply Terraform plan\n        run: terraform apply -auto-approve \n        working-directory: ./.bump/\n        if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'\n        env:\n          AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}\n          AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}\n          \n      - name: Remove versioned zip from Terraform state\n        run: terraform state rm aws_s3_bucket_object.versioned_zip \n        working-directory: ./.bump/\n        if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'\n\n      - name: Commit Terraform state\n        uses: EndBug/add-and-commit@v7\n        if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'\n        with:\n          message: 'Create Terraform state'\n          add: '*.tfstate'\n\n"
  },
  {
    "path": ".gitignore",
    "content": ".bump/.terraform"
  },
  {
    "path": "License",
    "content": "MIT License\n\nCopyright (c) 2021 Alasdair Monk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "config.yml",
    "content": "app_name: AppExample \napp_filename: AppExample.zip # Should match exactly the .zip file found in ./release/\ns3_bucket_name: app-example-distribution # Must be unique\n\n# More variables need to be added to your environment. See the readme\n"
  },
  {
    "path": "readme.md",
    "content": "\n![](.bump/assets/artwork.png)\n\nBump is an automated pipeline for releasing apps with [Sparkle](https://sparkle-project.org)\n\n**Features:**\n\n* 🚀  Get an end-to-end Sparkle release pipeline running in 60 seconds\n* ✍️  Create & maintain a Sparkle changelog from a single markdown file\n* 🔐  Automatic Sparkle certificate and signature handling\n* 📦  Automatic release versioning in your changelog and on S3\n* 🔑  Bring your own AWS account\n* 🚐  Can be [self-hosted](#running-locally--self-hosted)\n\nReady to try it? [Get started](#getting-started).\n\nPlease note;\n\n* **Bump has not been tested with the Sparkle 2 Beta**. In theory it should be perfectly compatible but it has only been tested with Sparkle 1.x\n* You'll need an **AWS access key and secret key** to use Bump as it automatically manages an S3 bucket for your Sparkle changelog file and app archives\n* Bump has only been tested with macOS Sparkle releases, not Sparkle-compatible distributions available for other platforms\n* Bump doesn't support Delta updates with Sparkle (yet!)\n\n---\n\n## Contents\n\n- [Contents](#contents)\n- [Getting started](#getting-started)\n  - [1. Create a new repo using this template](#1-create-a-new-repo-using-this-template)\n  - [2. Update variables](#2-update-variables)\n  - [3. Create secrets](#3-create-secrets)\n  - [4. Creating a  release](#4-creating-a--release)\n- [Appendix](#appendix)\n  - [S3 Information](#s3-information)\n  - [App archive support](#app-archive-support)\n  - [Release frontmatter](#release-frontmatter)\n  - [Running locally / self-hosted](#running-locally--self-hosted)\n  - [API Support](#api-support)\n  - [Updating from a previous version of Bump](#updating-from-a-previous-version-of-bump)\n\n## Getting started\n\n### 1. Create a new repo using this template\n\n[Create a new repo using this template](https://github.com/replay-software/bump/generate). This will copy the entire directory structure into your own GitHub account.\n\n### 2. Update variables\n\nEdit `config.yml` and replace the default values;\n\n```yaml\napp_name: AppExample \napp_filename: AppExample.zip\ns3_bucket_name: app-example-distribution\n```\n\n### 3. Create secrets\n\nIn the Settings of your repo, create the following secrets;\n\n| Secret name           | Required? | Description                                                                                                                    |\n|-----------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------|\n| `AWS_ACCESS_KEY`      |     ☑️     | An AWS access key that has permissions to create an S3 bucket                                                                  |\n| `AWS_SECRET_KEY`      |     ☑️     | An AWS secret key                                                                                                              |\n| `SPARKLE_PRIVATE_KEY` |           | A Sparkle private key. You can find this in your macOS keychain. You can omit this but it is encouraged to sign your releases. |\n\n### 4. Creating a  release\n\n1. Place your notarised, zipped app in the `./release/` folder. The name of the zip should match the `app_filename` you have set in `config.yml`. Ensure you **delete any other `.zip`** that exists in this directory.\n2. Edit `./release/latest.md` to reflect this new release. You will want to change the version number and probably add a description. [View the list](#release-frontmatter) of Sparkle attributes you can set in this file\n3. Create a pull request into the `main` or `master` branch (Bump supports both) of your repository. \n\n**Upon opening a pull request**, Bump will create and commit a new `changelog.xml` into your branch *not release anything publicly*.\n\n**Upon merging to `main`/`master`**, Bump will push your new `changelog.xml` and app release to your S3 bucket, making it publicly available to your customers.\n\nFind the link to your publicly hosted `changelog.xml` from Actions → Latest run → Build and expand the \"Apply Terraform plan\" panel to see the output. It will be in the format `https://{{bucketName}}.s3.amazonaws.com/changelog.xml`\n\n\n---\n\n## Appendix\n\n### S3 Information\n\nBy default, Bump will use aws region `us-east-1`. You can override this by changing the Terraform plan at `.bump/main.tf`.\n\n### App archive support\n\nBump supports serving the following app archive types;\n\n* `.zip`\n* `.dmg`\n* `.tar.gz`\n\n### Release frontmatter\n\nThe following keys can be used in the `./release/lastest.md` frontmatter;\n\n| Key Name               | Required? | Type   | Example              | Description                                                                                                                                    |\n|------------------------|-----------|--------|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `version`              | ☑️         | string | `\"1.2.0\"` or `\"100\"` | The version of your app                                                                                                                        |\n| `marketingVersion`     |           | string | `\"1.0\"`              | Can be used in addition to `version`. **Note:** setting this property means you should use `version` value for the build number (e.g. `\"100\"`). [Read the Sparkle documentation](https://sparkle-project.org/documentation/publishing/#publishing-an-update) on `shortVersionString` for more info |\n| `minimumSystemVersion` |           | string | `\"10.5\"`             | The lowest version of macOS that this release supports                                                                                         |\n\n### Running locally / self-hosted\n\nBump has been crafted to work with GitHub Actions but can also be run locally. Some things to note;\n\n* Expose the [required secrets](#3-create-secrets) as environment variables\n* [Bump Core](https://github.com/replay-software/bump-core), the binary distributed as part of Bump which is responsible for generating `changelog.xml`, is contained in a seperate repo\n* Run the [Bump Core CLI](https://github.com/replay-software/bump-core) from the root of the project (e.g. `./.bump/bin/bump`). \n* You can use [Act](https://github.com/nektos/act) to emulate GitHub Actions on any platform\n\n### API Support\n\nBump generates a JSON version of the changelog so that you can easily consume the changelog in a web app. To use it, find your changelog URL and replace the extension with `.json`\n\ne.g. `https://your-bucket-url.s3.amazonaws.com/changelog.xml` → `https://your-bucket-url.s3.amazonaws.com/changelog.json`\n\n**Note:** the default setting for CORS access is to allow all origins. To change this edit the `cors` stanza in the Terraform script at `./bump/main.tf`\n\n### Updating from a previous version of Bump\n\nUpdating Bump is easy. Simply copy the `.bump` folder from this repository to your own.\n"
  },
  {
    "path": "release/latest.md",
    "content": "---\nversion: \"1.0\"\n---\n\nHello World\n"
  }
]