Skip to content

Commit b0bf0b1

Browse files
authored
ci: Fix auto-release (#1072)
1 parent 4139f9e commit b0bf0b1

File tree

2 files changed

+8
-37
lines changed

2 files changed

+8
-37
lines changed

.github/workflows/release-automated.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
if: github.event_name == 'push' && github.ref_type == 'branch'
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 10
23-
outputs:
24-
dart_tag: ${{ steps.dart-release.outputs.new_release_git_tag }}
25-
flutter_tag: ${{ steps.flutter-release.outputs.new_release_git_tag }}
2623
permissions:
2724
contents: write
2825
issues: write
@@ -41,24 +38,12 @@ jobs:
4138
- name: Install dependencies
4239
run: npm ci
4340
- name: Run semantic-release for dart package
44-
id: dart-release
4541
run: npx semantic-release
4642
env:
4743
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
4844
PKG_NAME: dart
4945
- name: Run semantic-release for flutter package
50-
id: flutter-release
5146
run: npx semantic-release
5247
env:
5348
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
5449
PKG_NAME: flutter
55-
publish:
56-
needs: release
57-
if: needs.release.outputs.dart_tag != '' || needs.release.outputs.flutter_tag != ''
58-
uses: ./.github/workflows/release-publish.yml
59-
permissions:
60-
id-token: write
61-
contents: write
62-
with:
63-
dart_tag: ${{ needs.release.outputs.dart_tag }}
64-
flutter_tag: ${{ needs.release.outputs.flutter_tag }}

.github/workflows/release-publish.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,11 @@ on:
44
tags:
55
- "dart-[0-9]+.[0-9]+.[0-9]+*"
66
- "flutter-[0-9]+.[0-9]+.[0-9]+*"
7-
workflow_call:
8-
inputs:
9-
dart_tag:
10-
required: false
11-
type: string
12-
description: 'Dart package version tag (dart-#.#.#)'
13-
flutter_tag:
14-
required: false
15-
type: string
16-
description: 'Flutter package version tag (flutter-#.#.#)'
177
env:
18-
# For tag push: extract from github.ref_name
19-
# For workflow_call: use inputs
208
package: ${{ startsWith(github.ref_name, 'dart-') && 'dart' || startsWith(github.ref_name, 'flutter-') && 'flutter' || '' }}
21-
dart_tag_resolved: ${{ inputs.dart_tag || (startsWith(github.ref_name, 'dart-') && github.ref_name || '') }}
22-
flutter_tag_resolved: ${{ inputs.flutter_tag || (startsWith(github.ref_name, 'flutter-') && github.ref_name || '') }}
239
jobs:
2410
pub-publish-dart:
25-
if: inputs.dart_tag != '' || startsWith(github.ref_name, 'dart-')
11+
if: startsWith(github.ref_name, 'dart-')
2612
runs-on: ubuntu-latest
2713
timeout-minutes: 10
2814
permissions:
@@ -31,7 +17,7 @@ jobs:
3117
- name: Checkout code
3218
uses: actions/checkout@v4
3319
with:
34-
ref: ${{ env.dart_tag_resolved }}
20+
ref: ${{ github.ref_name }}
3521
- name: Setup dart
3622
uses: dart-lang/setup-dart@v1
3723
with:
@@ -50,7 +36,7 @@ jobs:
5036
run: dart pub publish --force
5137

5238
pub-publish-flutter:
53-
if: inputs.flutter_tag != '' || startsWith(github.ref_name, 'flutter-')
39+
if: startsWith(github.ref_name, 'flutter-')
5440
runs-on: ubuntu-latest
5541
timeout-minutes: 10
5642
permissions:
@@ -59,7 +45,7 @@ jobs:
5945
- name: Checkout code
6046
uses: actions/checkout@v4
6147
with:
62-
ref: ${{ env.flutter_tag_resolved }}
48+
ref: ${{ github.ref_name }}
6349
- name: Setup dart
6450
uses: dart-lang/setup-dart@v1
6551
with:
@@ -86,15 +72,15 @@ jobs:
8672
run: dart pub publish --force
8773

8874
docs-publish-dart:
89-
if: inputs.dart_tag != '' || startsWith(github.ref_name, 'dart-')
75+
if: startsWith(github.ref_name, 'dart-')
9076
needs: pub-publish-dart
9177
runs-on: ubuntu-latest
9278
timeout-minutes: 15
9379
steps:
9480
- name: Checkout code
9581
uses: actions/checkout@v4
9682
with:
97-
ref: ${{ env.dart_tag_resolved }}
83+
ref: ${{ github.ref_name }}
9884
- name: Setup dart
9985
uses: dart-lang/setup-dart@v1
10086
- name: Install dart dependencies
@@ -109,15 +95,15 @@ jobs:
10995
destination_dir: dart
11096

11197
docs-publish-flutter:
112-
if: inputs.flutter_tag != '' || startsWith(github.ref_name, 'flutter-')
98+
if: startsWith(github.ref_name, 'flutter-')
11399
needs: pub-publish-flutter
114100
runs-on: ubuntu-latest
115101
timeout-minutes: 15
116102
steps:
117103
- name: Checkout code
118104
uses: actions/checkout@v4
119105
with:
120-
ref: ${{ env.flutter_tag_resolved }}
106+
ref: ${{ github.ref_name }}
121107
- name: Setup dart
122108
uses: dart-lang/setup-dart@v1
123109
- name: Setup flutter

0 commit comments

Comments
 (0)