From 68006e7ebb069229ea1eecc2694e9abdc2640183 Mon Sep 17 00:00:00 2001 From: Felipe Benevides Date: Tue, 23 Aug 2022 14:50:11 +0200 Subject: [PATCH] Automate versioning process (#67) * Automate versioning using labels --- .github/pull_request_template.md | 7 ++++ .github/workflows/prepare.yml | 34 +++++++++++++++++ pubspec.yaml | 64 +++++++++++++++----------------- 3 files changed, 70 insertions(+), 35 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/prepare.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..4420513 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ +## Description + +Add a short description of the change. If this is related to an issue, please add a reference to the issue. + +## CHANGELOG + +* [CHANGED] Describe your change here. Look at CHANGELOG.md to see the format. \ No newline at end of file diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml new file mode 100644 index 0000000..f73579c --- /dev/null +++ b/.github/workflows/prepare.yml @@ -0,0 +1,34 @@ +name: Prepare release + +on: + pull_request: + types: [ labeled ] + branches: + - master + +jobs: + prepare-release: + name: Prepare release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get current version + run: | + CURRENT_VERSION=$(yq '.version' pubspec.yaml) + echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV + - uses: actions/checkout@v2 + with: + repository: pusher/public_actions + token: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }} + path: .github/actions + - uses: ./.github/actions/prepare-version-bump + id: bump + with: + current_version: ${{ env.CURRENT_VERSION }} + - name: Push + shell: bash + run: | + echo "$(yq '.version = "${{ steps.bump.outputs.new_version }}"' pubspec.yaml)" > pubspec.yaml + git add pubspec.yaml CHANGELOG.md + git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}" + git push diff --git a/pubspec.yaml b/pubspec.yaml index 2e7d01b..b96af5c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,23 +4,19 @@ version: 2.0.1 homepage: https://github.com/pusher/pusher-channels-flutter repository: https://github.com/pusher/pusher-channels-flutter issue_tracker: https://github.com/pusher/pusher-channels-flutter/issues - environment: sdk: ">=2.12.0 <3.0.0" flutter: ">=1.20.0" - dependencies: flutter: sdk: flutter flutter_web_plugins: sdk: flutter js: ^0.6.3 - dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^1.0.4 - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -41,34 +37,32 @@ flutter: web: pluginClass: PusherChannelsFlutterWeb fileName: pusher_channels_flutter_web.dart - - # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # To add custom fonts to your plugin package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages +# To add assets to your plugin package, add an assets section, like this: +# assets: +# - images/a_dot_burr.jpeg +# - images/a_dot_ham.jpeg +# +# For details regarding assets in packages, see +# https://flutter.dev/assets-and-images/#from-packages +# +# An image asset can refer to one or more resolution-specific "variants", see +# https://flutter.dev/assets-and-images/#resolution-aware. +# To add custom fonts to your plugin package, add a fonts section here, +# in this "flutter" section. Each entry in this list should have a +# "family" key with the font family name, and a "fonts" key with a +# list giving the asset and other descriptors for the font. For +# example: +# fonts: +# - family: Schyler +# fonts: +# - asset: fonts/Schyler-Regular.ttf +# - asset: fonts/Schyler-Italic.ttf +# style: italic +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/custom-fonts/#from-packages