From 15e12b33d222fe9e02f6dd030f974b95ef8df2e1 Mon Sep 17 00:00:00 2001 From: Tom Scott Date: Fri, 24 Feb 2023 16:59:09 -0500 Subject: [PATCH] update workflows and add changelog generation --- .github/release.yml | 13 +++++++++++++ .github/workflows/ci.yml | 19 +++++++++++++++++++ .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/ruby.yml | 26 -------------------------- 4 files changed, 63 insertions(+), 26 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/ruby.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..5c8fd98 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,13 @@ +changelog: + exclude: + labels: [dependencies] + authors: [renovate-bot] + categories: + - title: Breaking Changes + labels: [breaking] + - title: New Features + labels: [enhancement] + - title: Bug Fixes + labels: [bug] + - title: Other Changes + labels: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1ef558b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI +on: + push: + branches-ignore: [master] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ["2.6", "2.7", "3.0", "3.1", "jruby"] + + steps: + - uses: actions/checkout@v3 + - run: sudo apt-get install -y --no-install-recommends redis-server + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - run: bundle exec rake diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3574d3d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish +on: + push: + tags: [v*] +permissions: + contents: write +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - run: | + mkdir -p ~/.gem + cat << EOF > ~/.gem/credentials + --- + :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} + EOF + + chmod 0600 ~/.gem/credentials + - run: bundle exec rake release + - uses: softprops/action-gh-release@v1 + with: + files: "*.gem" + generate_release_notes: true + prerelease: ${{ contains(github.ref, '.pre') }} diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml deleted file mode 100644 index 304028e..0000000 --- a/.github/workflows/ruby.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Ruby - -on: - push: - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - ruby-version: ['2.6', '2.7', '3.0', '3.1', 'jruby'] - - steps: - - uses: actions/checkout@v3 - - name: Install redis - run: sudo apt-get install -y --no-install-recommends redis-server - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true - - name: Run tests - run: bundle exec rake