1717 uses : WyriHaximus/github-action-get-previous-tag@master
1818
1919 - name : Print Latest Version
20- run : echo Latest tag: ${{ steps.previoustag.outputs.tag }}
20+ run : " echo Latest tag: ${{ steps.previoustag.outputs.tag }}"
2121
2222 - name : Get Version from pubspec.yaml
2323 id : config
@@ -27,62 +27,57 @@ jobs:
2727 version_name : version
2828
2929 - name : Print New Version
30- run : echo New version from pubspec.yaml: ${{ steps.config.outputs.version_name }}
30+ run : " echo New version from pubspec.yaml: ${{ steps.config.outputs.version_name }}"
3131
3232 - name : Compare Version
3333 if : ${{ steps.config.outputs.version_name == steps.previoustag.outputs.tag }}
3434 run : |
35- echo "The version from pubspec.yaml is the same as the latest release tag. Please update the version. "
35+ echo "The version from pubspec.yaml is the same as the previous tag, please update the version"
3636 exit 1
3737
3838 - name : Save New Version
39- run : echo ${{ steps.config.outputs.version_name }} > version.txt
39+ run : " echo ${{ steps.config.outputs.version_name }} > version.txt"
4040
41- - name : Upload New Version Artifact
41+ - name : Upload New Version
4242 uses : actions/upload-artifact@v4
4343 with :
44- name : version
44+ name : home
4545 path : version.txt
4646
4747 publish :
48- needs : check_version
48+ needs :
49+ - check_version
4950 runs-on : ubuntu-20.04
5051 steps :
5152 - name : Checkout Repository
5253 uses : actions/checkout@v3
5354
54- - name : Set up Flutter
55- uses : subosito/ flutter-action@v2
55+ - name : Publish Package
56+ uses : Omega365/actions- flutter-pub-publisher@master
5657 with :
57- flutter-version : stable
58-
59- - name : Set Pub Credentials
60- run : echo "${{ secrets.CREDENTIAL_JSON }}" > ~/.pub-cache/credentials.json
61-
62- - name : Verify Pub Credentials File
63- run : |
64- if [ -f ~/.pub-cache/credentials.json ]; then
65- echo "Credentials file exists."
66- else
67- echo "Credentials file not found!" && exit 1
68- fi
69-
70- - name : Publish Package to Pub
71- run : flutter pub publish --force
58+ credential : " ${{ secrets.CREDENTIAL_JSON }}"
59+ dry_run : false
60+ flutter_package : true
61+ skip_test : true
7262
7363 tag :
7464 name : " Tag Version"
75- needs : publish
65+ needs :
66+ - publish
7667 runs-on : ubuntu-20.04
7768 steps :
7869 - name : Download New Version
7970 uses : actions/download-artifact@v4
8071 with :
81- name : version
72+ name : home
8273
83- - name : Read and Tag New Version
74+ - name : Set and Tag the New Version
8475 run : |
85- NEW_VERSION=$(cat version/version.txt)
86- echo "Tagging version: $NEW_VERSION"
87- git tag $NEW_VERSION
88- git push origin $NEW_VERSION
76+ echo "RELEASE_VERSION=$(cat home/version.txt)" >> $GITHUB_ENV
77+ shell : bash
78+
79+ - name : Create New Tag
80+ 81+ with :
82+ repo-token : " ${{ secrets.GITHUB_TOKEN }}"
83+ tag : " ${{ env.RELEASE_VERSION }}"
0 commit comments