From 63c2f1eecf053abdcd45cec7e4306f53a45720c3 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Thu, 19 Sep 2024 09:08:18 -0700 Subject: [PATCH] Update README and delete cargo-generate.yaml --- .github/workflows/cargo-generate.yaml | 124 -------------------------- README.md | 25 +----- 2 files changed, 1 insertion(+), 148 deletions(-) delete mode 100644 .github/workflows/cargo-generate.yaml diff --git a/.github/workflows/cargo-generate.yaml b/.github/workflows/cargo-generate.yaml deleted file mode 100644 index 59a54d6..0000000 --- a/.github/workflows/cargo-generate.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# This workflow is used to automatically update the `cargo-generate` branch. If you copied the -# template, you can safely delete this. :) -# -# BE VERY CAREFUL about what this workflow runs, since IT HAS THE ABILITY TO DELETE THE ENTIRE -# REPOSITORY'S CONTENTS. For this reason, stick to pre-installed tools and trusted actions (such as -# those hosted from the `actions` organization.) - -name: Update `cargo-generate` branch - -on: - # Update `cargo-generate` from `main` every time `main` is updated. - push: - branches: main - # Allow this workflow to be manually triggered. - workflow_dispatch: - -# This workflows also has write-access for content and workflow, but it is through -# CARGO_GENERATE_PAT. -permissions: - # We need write permissions to create new issues. - issues: write - -jobs: - update: - runs-on: ubuntu-latest - # Only run this job on the source repository, skipping forks, unless it was manually triggered. - if: ${{ github.repository == 'TheBevyFlock/bevy_quickstart' || github.event_name == 'workflow_dispatch' }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - # Fetch entire history, since we need it all to successfully merge. - fetch-depth: 0 - # Specify a personal access token, since the default one does not let workflows modify - # the `.github/workflows` folder. This PAT needs write permissions for Contents and - # Workflows. I recommend creating a scoped token that only has access to this repository. - token: ${{ secrets.CARGO_GENERATE_PAT }} - - - name: Configure Git user - env: - # From https://github.com/actions/checkout/pull/1707. - NAME: github-actions[bot] - EMAIL: 41898282+github-actions[bot]@users.noreply.github.com - run: | - git config user.name "${NAME}" - git config user.email "${EMAIL}" - - - name: Switch to `cargo-generate` branch - run: git checkout cargo-generate - - - name: Merge `main` branch into `cargo-generate` - id: merge - # We use `--no-edit` to prevent any editor from being opened, since we can't close it. - run: git merge main --no-edit --verbose - - - name: Handle merge conflict - # Only run this if merging failed. - if: ${{ failure() && steps.merge.outcome == 'failure' }} - env: - TITLE: Failed to auto-update `cargo-generate` - BODY: | - There were merge conflicts while trying to update `cargo-generate` from `main`. You can - do it manually by running: - - ```bash - # Update your local copy of the `main` branch. - git switch main - git pull - # Checkout the `cargo-generate` branch. - git checkout cargo-generate - # Merge changes from `main` to `cargo-generate`. You will have to fix merge conflicts. - git merge main - ``` - -
- git status - - ``` - GIT_STATUS_IDENTIFIER - ``` -
- -
- git diff --diff-filter=U - - ```diff - GIT_DIFF_IDENTIFIER - ``` -
- - _This is an automated message created by `cargo-generate.yaml`._ - # This is required to use the `gh` CLI. - GH_TOKEN: ${{ github.token }} - run: | - # Get a list of the IDs of open issues created by this action, then count them using JQ. - OPEN_ISSUES="$( - gh issue list \ - --search "is:issue is:open author:app/github-actions in:title ${TITLE}" \ - --json id \ - --jq '. | length' - )" - - # If an issue already exists, do not create another. - if [[ "${OPEN_ISSUES}" -gt 0 ]]; then - echo 'An issue already exists on merge conflicts! Exiting without creating another.' - exit 0 - fi - - GIT_STATUS="$(git status)" - - # Filter the diff to only include files with merge conflicts. - GIT_DIFF="$(git diff --diff-filter=U)" - - # Replace `GIT_STATUS_IDENTIFIER` and `GIT_DIFF_IDENTIFIER` with their outputs. - BODY="${BODY/GIT_STATUS_IDENTIFIER/"${GIT_STATUS}"}" - BODY="${BODY/GIT_DIFF_IDENTIFIER/"${GIT_DIFF}"}" - - # Create the issue. - gh issue create --title "${TITLE}" --body "${BODY}" - - - name: Push changes - # Only run if merging succeeded. - if: ${{ success() && steps.merge.outcome == 'success' }} - run: git push diff --git a/README.md b/README.md index 5a656d9..d26d03a 100644 --- a/README.md +++ b/README.md @@ -22,34 +22,11 @@ See our [Design Document](./docs/design.md) for more information on how we struc Install [`cargo-generate`](https://github.com/cargo-generate/cargo-generate) and run the following command: ```sh -cargo generate TheBevyFlock/bevy_quickstart --branch cargo-generate -``` - -Then navigate to the newly generated directory and run the following commands: - -```sh -git branch --move main -cargo update -git commit -am 'Initial commit' +cargo generate TheBevyFlock/bevy_quickstart ``` Then [create a GitHub repository](https://github.com/new) and push your local repository to it. -
- This template can also be set up manually. - -Navigate to the top of [this GitHub repository](https://github.com/TheBevyFlock/bevy_quickstart/) and select `Use this template > Create a new repository`: - -![UI demonstration](./docs/img/readme-manual-setup.png) - -Clone your new Github repository to a local repository and push a commit with the following changes: - -- Delete `LICENSE`, `README`, and `docs/` files. -- Search for and replace instances of `bevy_quickstart` with the name of your project. -- Adjust the `env` variables in [`.github/workflows/release.yaml`](./.github/workflows/release.yaml). - -
- ## Write your game The best way to get started is to play around with what you find in [`src/demo/`](./src/demo).