Skip to content

v2.3.0 Add an Option to Skip Webhook Signature Verification #12

v2.3.0 Add an Option to Skip Webhook Signature Verification

v2.3.0 Add an Option to Skip Webhook Signature Verification #12

Workflow file for this run

name: Publish package to the RubyGems.org
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'The version to release. v prefix is required (e.g. v1.10.0)'
required: true
jobs:
release-package:
name: Push gem to RubyGems.org
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
issues: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ruby/setup-ruby@3fee6763234110473bd57dd4595c5199fce2c510 # v1.258.0
with:
bundler-cache: true
ruby-version: 3.3
- name: Update version file with the release version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION=${{ github.event.inputs.version }}
else
VERSION=${{ github.event.release.tag_name }}
fi
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
sed -i "s/VERSION = \".*\"/VERSION = \"$VERSION\"/" lib/line/bot/version.rb
sed -i "s/line-bot-api (.*)/line-bot-api ($VERSION)/" Gemfile.lock
cat lib/line/bot/version.rb
# commit
git config user.name github-actions
git config user.email github-actions@github.com
git add lib/line/bot/version.rb Gemfile.lock
git commit -m "Set version to $VERSION"
- uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
- name: Create GitHub Issue on Failure
if: failure()
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const { owner, repo } = context.repo;
const version = process.env.VERSION;
const issueTitle = `Release job for ${version} failed`;
const issueBody = `The release job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`;
const assignees = [context.actor];
await github.rest.issues.create({
owner,
repo,
title: issueTitle,
body: issueBody,
assignees
});
deploy-docs:
needs: [release-package]
permissions:
contents: read
pages: write
issues: write
id-token: write
uses: ./.github/workflows/deploy-doc.yml