diff --git a/.github/workflows/publish-to-pubdev.yml b/.github/workflows/publish-to-pubdev.yml index e61b590..ef9ab5f 100644 --- a/.github/workflows/publish-to-pubdev.yml +++ b/.github/workflows/publish-to-pubdev.yml @@ -1,69 +1,23 @@ -name: Publish to Pub.dev +# .github/workflows/publish.yml +name: Publish to pub.dev on: push: tags: - - 'v*.*.*' # This triggers the action for tags like v1.0.0, v2.3.4, etc. + - 'v[0-9]+.[0-9]+.[0-9]+' # tag pattern on pub.dev: 'v{{version}' +# Publish using custom workflow jobs: - build: + publish: + permissions: + id-token: write # Required for authentication using OIDC runs-on: ubuntu-latest - steps: - # Checkout repository - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetches all history for all tags and branches - - # Set up Flutter - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.29.0' # Specify exact version instead of just 'stable' - channel: 'stable' - - # Cache Flutter dependencies to speed up workflow - - name: Cache Flutter dependencies - uses: actions/cache@v3 - with: - path: ~/.pub-cache - key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} - restore-keys: | - ${{ runner.os }}-pub- - - # Install dependencies + - uses: actions/checkout@v3 + - uses: dart-lang/setup-dart@v1 - name: Install dependencies run: flutter pub get - - # Parse the tag to get the version without 'v' prefix - - name: Extract version from tag - id: get_version - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - - # Verify the pubspec version matches the tag - - name: Verify version - run: | - echo "Tag version: $VERSION" - PUBSPEC_VERSION=$(grep -m 1 'version:' pubspec.yaml | awk '{print $2}') - echo "Pubspec version: $PUBSPEC_VERSION" - if [ "$VERSION" != "$PUBSPEC_VERSION" ]; then - echo "Error: The version in pubspec.yaml ($PUBSPEC_VERSION) does not match the tag version ($VERSION)" - exit 1 - fi - - # Publish to pub.dev - - name: Publish to Pub.dev - env: - PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }} - run: | - # Configure Pub credentials - mkdir -p ~/.pub-cache - echo "$PUB_DEV_TOKEN" > ~/.pub-cache/credentials.json - # Publish the package - flutter pub publish --force - - # Clean up after publish - - name: Clean up - run: | - rm -f ~/.pub-cache/credentials.json \ No newline at end of file + # Here you can insert custom steps you need + # - run: dart tool/generate-code.dart + - name: Publish + run: flutter pub publish --force \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 19e5131..24eec40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.1 + +* Minor readme update + ## 0.2.0 * Updated SDK constraints to support newer Dart and Flutter versions. diff --git a/README.md b/README.md index df01915..db32f21 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You should add the following to your `pubspec.yaml` file: ```yaml dependencies: - native_flutter_proxy: ^0.1.14 + native_flutter_proxy: latest ``` diff --git a/pubspec.yaml b/pubspec.yaml index cc0b4c1..ef4e623 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: native_flutter_proxy description: A flutter plugin to read and set network proxy info from native. -version: 0.2.0 +version: 0.2.1 homepage: https://github.com/victorblaess/native_flutter_proxy environment: