Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New publish method #62

Merged
merged 5 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.2.2

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.5.0
with:
distribution: temurin
java-version: "17"

- name: Flutter action
uses: subosito/flutter-action@v2.8.0
uses: subosito/flutter-action@v2.16.0
with:
channel: stable

- name: Flutter version
run: flutter --version

- name: Cache pubspec dependencies
uses: actions/cache@v3.0.7
uses: actions/cache@v4.1.2
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
Expand All @@ -52,7 +52,7 @@ jobs:
build-pubspec-

- name: Cache build runner
uses: actions/cache@v2
uses: actions/cache@v4.1.2
with:
path: |
**/.dart_tool
Expand Down
67 changes: 14 additions & 53 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,31 @@
name: Publish plugin

on:
release:
types: [published]
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.2.2

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.5.0
with:
distribution: temurin
java-version: "17"

- name: Flutter action
uses: subosito/flutter-action@v2.8.0
uses: subosito/flutter-action@v2.16.0
with:
channel: stable

- name: Flutter version
run: flutter --version

- name: Cache pubspec dependencies
uses: actions/[email protected]
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
build-pubspec-

- name: Cache build runner
uses: actions/cache@v2
with:
path: |
**/.dart_tool
**/*.g.dart
**/*.mocks.dart
**/*.config.dart
key: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
restore-keys: |
build-runner-

- name: Download pub dependencies
run: flutter pub get

Expand All @@ -60,30 +35,16 @@ jobs:
- name: Run analyzer
run: flutter analyze --fatal-infos

- name: Install coverage tools
run: flutter pub global activate coverage

- name: Run tests
run: flutter test --coverage

- name: Setup Pub Credentials
shell: bash
env:
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
run: |
sh ./pub_login.sh

- name: Check Publish Warnings
run: flutter pub publish --dry-run

- name: Publish Package
run: flutter pub publish -f

- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage/lcov.info
publish:
needs: 'test'
permissions:
id-token: write # Required for authentication using OIDC
uses: git-elliot/setup-dart/.github/workflows/publish.yml@main # Added build_runner step
with:
environment: 'pub.dev'
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## 2.0.3
1. Dependencies updated.

## 2.0.2
1. Mdns search works on iOS now.

Expand Down
36 changes: 0 additions & 36 deletions pub_login.sh

This file was deleted.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: network_tools_flutter
description: Extended features of network_tools package for flutter framework supporting iOS and Android
version: 2.0.2
version: 2.0.3
issue_tracker: https://github.com/osociety/network_tools_flutter/issues
repository: https://github.com/osociety/network_tools_flutter

Expand Down
Loading