From 7325cee528dee6ddba5074bb3433e87381a3d88f Mon Sep 17 00:00:00 2001 From: Nicolas Languille Date: Tue, 30 Mar 2021 11:39:11 +0100 Subject: [PATCH] add gem-deploy gh action (#45) * add gem-deploy gh action * move to version 6.0.1 to avoid conflicts with already exisiting 6.0.0 when pushing the new tag * add change log entry for version 6.0.1 --- .github/workflows/gem-deploy.yml | 43 +++++++++++++++++++++++++++++++ CHANGELOG.txt | 3 +++ bin/prepare_changelog.sh | 5 ++++ lib/bing-ads-reporting/version.rb | 2 +- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/gem-deploy.yml create mode 100755 bin/prepare_changelog.sh diff --git a/.github/workflows/gem-deploy.yml b/.github/workflows/gem-deploy.yml new file mode 100644 index 0000000..310a321 --- /dev/null +++ b/.github/workflows/gem-deploy.yml @@ -0,0 +1,43 @@ +name: Gem deploy + +on: + push: + branches: + - master + +jobs: + release: + name: Tag & Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Tag + id: tag + uses: forward3d/gh-gem-tag-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tag_prefix: v + - name: Read latest Changelog entry + id: changelog + run: | + echo "::set-output name=changelog::`./bin/prepare_changelog.sh`" + - name: Create release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.tag.outputs.tag }} + release_name: Release ${{ steps.tag.outputs.tag }} + body: ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false + publish: + name: Build & Publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build and publish gem + uses: jstastny/publish-gem-to-github@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: forward3d diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9affb48..ab8942f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,6 @@ +* 6.0.1 + Add GH action to automate gem deploy to gh packages + * 6.0.0 Remove curb in favor of httparty BREAKING CHANGE: Remove InsightService diff --git a/bin/prepare_changelog.sh b/bin/prepare_changelog.sh new file mode 100755 index 0000000..7648d0c --- /dev/null +++ b/bin/prepare_changelog.sh @@ -0,0 +1,5 @@ +changelog=$(sed -E -n '2,/^\* [0-9]+\.[0-9]+\.[0-9]+/ p' CHANGELOG.txt | sed '$d') +changelog="${changelog//'::'/'@'}" +changelog="${changelog//'%'/'%25'}" +changelog="${changelog//$'\n'/'%0A'}" +echo "${changelog//$'\r'/'%0D'}" diff --git a/lib/bing-ads-reporting/version.rb b/lib/bing-ads-reporting/version.rb index 669f899..078ba30 100644 --- a/lib/bing-ads-reporting/version.rb +++ b/lib/bing-ads-reporting/version.rb @@ -1,3 +1,3 @@ module BingAdsReporting - VERSION = '6.0.0'.freeze + VERSION = '6.0.1'.freeze end