Skip to content

Commit

Permalink
Automate versioning process (#67)
Browse files Browse the repository at this point in the history
* Automate versioning using labels
  • Loading branch information
fbenevides authored Aug 23, 2022
1 parent 7252afb commit 68006e7
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 35 deletions.
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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.
34 changes: 34 additions & 0 deletions .github/workflows/prepare.yml
Original file line number Diff line number Diff line change
@@ -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
64 changes: 29 additions & 35 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 68006e7

Please sign in to comment.