v2.2.0 Support new AudienceGroupType POP_AD_IMP to Audience Group API #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.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@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
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 |