diff --git a/.github/workflows/release.yml b/.github/workflows/release-js.yml similarity index 68% rename from .github/workflows/release.yml rename to .github/workflows/release-js.yml index f7d16480..d88f118d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-js.yml @@ -20,37 +20,7 @@ jobs: run: | npm run lint npm t - - publish-ruby: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - name: Install and test - run: | - bundle install - bundle exec rake - working-directory: ./ruby - - name: Configure credentials - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials - env: - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - - name: Build gem - run: | - bundle exec rake build - working-directory: ./ruby - - name: Publish to rubygems.org - run: | - gem push pkg/asciidoctor-kroki-${GITHUB_REF#refs/tags/v}.gem - working-directory: ./ruby - publish-js: + publish: needs: build runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release-ruby.yml b/.github/workflows/release-ruby.yml new file mode 100644 index 00000000..b646dcf8 --- /dev/null +++ b/.github/workflows/release-ruby.yml @@ -0,0 +1,59 @@ +name: Release Ruby + +on: + push: + tags: + - 'ruby-v*' # Push events to matching ruby-v*, i.e. ruby-v1.0, ruby-v2.1.3 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.6' + - run: bundle install + working-directory: ./ruby + - run: bundle exec rake + working-directory: ./ruby + publish: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.6' + - name: Install and test + run: | + bundle install + bundle exec rake + working-directory: ./ruby + - name: Configure credentials + run: | + mkdir -p $HOME/.gem + touch $HOME/.gem/credentials + chmod 0600 $HOME/.gem/credentials + printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials + env: + RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} + - name: Build gem + run: | + bundle exec rake build + working-directory: ./ruby + - name: Publish to rubygems.org + run: | + gem push pkg/asciidoctor-kroki-${GITHUB_REF#refs/tags/ruby-v}.gem + working-directory: ./ruby + # create the GitHub release + - name: Create release + id: create_release + uses: actions/create-release@v1.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false diff --git a/RELEASE.md b/RELEASE.md index 2fbcd9c5..cb858910 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,9 +1,16 @@ # Release -How to perform a release: +How to perform a release. + +**Ruby:** 1. Update the version number `s.version` in `ruby/asciidoctor-kroki.gemspec` 2. Run `bundle exec rake` in the `ruby` directory to make sure that everything is working 3. Commit both `asciidoctor-kroki.gemspec` and `Gemfile.lock` files -4. Run `npm version x.y.z` at the root of the repository +4. Create a tag starting with `ruby-v` (eg. `ruby-v1.2.3`) 5. Push your changes with the tag: git push origin master --tags + +**JavaScript:** + +1. Run `npm version x.y.z` at the root of the repository +2. Push your changes with the tag: git push origin master --tags