From f91d69492fcefb195ed661912e95e14f48126266 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Mon, 13 Dec 2021 20:28:56 -0500 Subject: [PATCH 1/6] Fix branch name --- .github/workflows/build.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75f5729..f181dc0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Lint & build on: push: branches: - - main + - master jobs: build: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fbbc47f..313ef19 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,7 +4,7 @@ on: pull_request: types: [opened, synchronize, ready_for_review, edited, closed] branches: - - main + - master jobs: build: From 7c1e860c50587765c2dd4fa1e5deb28337ca2551 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Thu, 16 Dec 2021 13:59:38 -0500 Subject: [PATCH 2/6] Add PR template --- .github/pull_request_template.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..6ff7b29 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ +Closes # + + + +- [ ] I updated the changelog From ea6367ccdc1e62da8e83c5e0be02328d5b23f8dd Mon Sep 17 00:00:00 2001 From: Max Isom Date: Thu, 16 Dec 2021 14:00:21 -0500 Subject: [PATCH 3/6] Build every commit --- .github/workflows/build.yml | 51 +++++++++++++++++-------------------- .github/workflows/pr.yml | 18 ------------- 2 files changed, 24 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f181dc0..5eea299 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,31 +1,28 @@ name: Lint & build -on: - push: - branches: - - master +on: push jobs: - build: - name: Lint & build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v2 - with: - node-version: '16' - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ./node_modules - key: ${{ runner.OS }}-dependencies-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.OS }}-dependencies-${{ env.cache-name }}- - ${{ runner.OS }}-dependencies- - ${{ runner.OS }}- - - name: Install dependencies - run: yarn install - - name: Run lint - run: yarn lint - - name: Build - run: yarn build + build: + name: Lint & build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v2 + with: + node-version: '16' + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ./node_modules + key: ${{ runner.OS }}-dependencies-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-dependencies-${{ env.cache-name }}- + ${{ runner.OS }}-dependencies- + ${{ runner.OS }}- + - name: Install dependencies + run: yarn install + - name: Run lint + run: yarn lint + - name: Build + run: yarn build diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 313ef19..48646e6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,24 +7,6 @@ on: - master jobs: - build: - name: Build & lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v2 - with: - node-version: '16' - - - name: Install dependencies - uses: bahmutov/npm-install@v1 - - - name: Run lint - run: yarn lint - - - name: Build - run: yarn build - release: name: Release snapshot runs-on: ubuntu-latest From f6376048eb27e7e2f5c5305f931b23a2d026bbd8 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Thu, 16 Dec 2021 14:03:27 -0500 Subject: [PATCH 4/6] Add changelog, generate releases --- .github/workflows/publish-image.yml | 52 ----------------- .github/workflows/publish.yml | 91 +++++++++++++++++++++++++++++ CHANGELOG.md | 14 +++++ 3 files changed, 105 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/publish-image.yml create mode 100644 .github/workflows/publish.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml deleted file mode 100644 index ea41dd0..0000000 --- a/.github/workflows/publish-image.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Publish Docker image - -on: - push: - branches: master - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Limit concurrent builds to 1 - uses: softprops/turnstyle@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: codetheweb/muse:latest - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache,mode=max - - - name: Update Docker Hub description - uses: peter-evans/dockerhub-description@v2.1.0 - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - DOCKERHUB_REPOSITORY: codetheweb/muse - \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..51339b2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,91 @@ +name: Publish Docker image + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Get version from tag + id: tag_name + run: | + echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v} + shell: bash + + - name: Get Changelog Entry + id: changelog_reader + uses: mindsers/changelog-reader-action@v2 + with: + validation_depth: 10 + version: ${{ steps.tag_name.outputs.current_version }} + path: ./CHANGELOG.md + + - name: Create/update release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.changelog_reader.outputs.version }} + name: Release ${{ steps.changelog_reader.outputs.version }} + body: ${{ steps.changelog_reader.outputs.changes }} + prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} + draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} + allowUpdates: true + token: ${{ secrets.GITHUB_TOKEN }} + + publish: + runs-on: ubuntu-latest + steps: + - name: Set up Buildx + uses: docker/setup-buildx-action@v1 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get tags + id: get-tags + uses: Surgo/docker-smart-tag-action@v1 + with: + docker_image: codetheweb/muse + + - name: Wait on lint & build + uses: lewagon/wait-on-check-action@v1.1.1 + with: + ref: ${{ github.sha }} + check-name: 'Lint & build' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 10 + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: ${{ steps.get-tags.outputs.tag }} + platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + + - name: Update Docker Hub description + uses: peter-evans/dockerhub-description@v2.1.0 + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + DOCKERHUB_REPOSITORY: codetheweb/muse diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d6e9487 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] +### Added +- Initial release + +[Unreleased]: https://github.com/codetheweb/muse/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/codetheweb/muse/releases/tag/v0.1.0 From a73fd840f7a521bd56bb3b1e3bb30234c175470d Mon Sep 17 00:00:00 2001 From: Max Isom Date: Thu, 16 Dec 2021 15:03:31 -0500 Subject: [PATCH 5/6] Update README --- .github/workflows/publish.yml | 3 +-- README.md | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 51339b2..12eebab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish Docker image +name: Make release & publish Docker image on: push: @@ -21,7 +21,6 @@ jobs: id: changelog_reader uses: mindsers/changelog-reader-action@v2 with: - validation_depth: 10 version: ${{ steps.tag_name.outputs.current_version }} path: ./CHANGELOG.md diff --git a/README.md b/README.md index ac6e0d3..069f41d 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,25 @@ Muse is written in TypeScript. You can either run Muse with Docker (recommended) Muse will log a URL when run. Open this URL in a browser to invite Muse to your server. Muse will DM the server owner after it's added with setup instructions. +#### Versioning + +The `master` branch acts as the developing / bleeding edge branch and is not guaranteed to be stable. + +When running a production instance, I recommend that you use the [latest release](https://github.com/codetheweb/muse/releases/). + + #### Docker +There are a variety of image tags available: +- `:2`: versions >= 2.0.0 +- `:2.1`: versions >= 2.1.0 and < 2.2.0 +- `:2.1.1`: an exact version specifier +- `:latest`: whatever the latest version is + (Replace empty config strings with correct values.) ```bash -docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='' -e SPOTIFY_CLIENT_ID='' -e SPOTIFY_CLIENT_SECRET='' -e YOUTUBE_API_KEY='' codetheweb/muse +docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='' -e SPOTIFY_CLIENT_ID='' -e SPOTIFY_CLIENT_SECRET='' -e YOUTUBE_API_KEY='' codetheweb/muse:latest ``` This starts Muse and creates a data directory in your current directory. @@ -47,7 +60,7 @@ version: '3.4' services: muse: - image: codetheweb/muse + image: codetheweb/muse:latest restart: always volumes: - ./muse:/data @@ -64,9 +77,10 @@ services: 1. `git clone https://github.com/codetheweb/muse.git && cd muse` 2. Copy `.env.example` to `.env` and populate with values -3. `yarn install` (or `npm i`) -4. `yarn build` (or `npm run build`) -5. `yarn start` (or `npm run start`) +3. I recommend checking out a tagged release with `git checkout v[latest release]` +4. `yarn install` (or `npm i`) +5. `yarn build` (or `npm run build`) +6. `yarn start` (or `npm run start`) **Note**: if you're on Windows, you may need to manually set the ffmpeg path. See [#345](https://github.com/codetheweb/muse/issues/345) for details. From 55c98ff2a937392a2f24d3ee3d3d7cb6e15ff178 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Thu, 16 Dec 2021 15:05:37 -0500 Subject: [PATCH 6/6] Don't create a new tag --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 12eebab..6055264 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,7 +27,7 @@ jobs: - name: Create/update release uses: ncipollo/release-action@v1 with: - tag: ${{ steps.changelog_reader.outputs.version }} + tag: ${GITHUB_REF#refs/tags} name: Release ${{ steps.changelog_reader.outputs.version }} body: ${{ steps.changelog_reader.outputs.changes }} prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}