Skip to content

updated

updated #23

Workflow file for this run

name: Package Publish
on:
push:
branches: [ release ]
jobs:
check_version:
name: "Check Version Tag"
runs-on: ubuntu-20.04
steps:
-
uses: actions/checkout@v3
-
continue-on-error: true
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
id: previoustag
name: "Get Latest Version"
uses: WyriHaximus/github-action-get-previous-tag@master
-
name: "Print Latest Version"
run: "echo ${{ steps.previoustag.outputs.tag }}"
-
id: config
name: "Get New Version"
uses: CumulusDS/get-yaml-paths-action@v0.1.0
with:
file: pubspec.yaml
version_name: version
-
name: "Print New Version"
run: "echo ${{ steps.config.outputs.version_name }}"
-
if: "steps.config.outputs.version_name == steps.previoustag.outputs.tag"
name: "Compare Version"
run: |
echo 'The version from your pubspec.yaml is the same as Release, Please update the version'
exit 1
-
run: "echo ${{ steps.config.outputs.version_name }} > version.txt"
shell: bash
-
name: "Upload New Version"
uses: actions/upload-artifact@v4
with:
name: home
path: version.txt
publish:
needs:
- check_version
runs-on: ubuntu-20.04
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: "Publish Package"
uses: Omega365/actions-flutter-pub-publisher@master
with:
credential: "${{secrets.CREDENTIAL_JSON}}"
dry_run: false
flutter_package: true
skip_test: true
tag:
name: "Tag Version"
needs:
- publish
runs-on: ubuntu-20.04
steps:
-
name: "Download New Version"
uses: actions/download-artifact@v4
with:
name: home
-
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
name: "Set and Tag the new version"
run: "echo \"::set-env name=RELEASE_VERSION::$(cat home/version.txt)\""
shell: bash
-
uses: tvdias/github-tagger@v0.0.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
tag: "${{env.RELEASE_VERSION}}"