forked from diegoveloper/flutter_percent_indicator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c020461
commit 38e4e54
Showing
6 changed files
with
122 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,70 +4,83 @@ on: | |
push: | ||
branches: [ release ] | ||
|
||
jobs: | ||
|
||
check_version: | ||
runs-on: ubuntu-latest | ||
name: 'Check Version Tag' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: 'Get Latest Version' | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@master" | ||
env: | ||
jobs: | ||
check_version: | ||
name: "Check Version Tag" | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- | ||
uses: actions/checkout@v1 | ||
- | ||
continue-on-error: true | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
continue-on-error: true | ||
- name: 'Print Latest Version' | ||
run: echo ${{ steps.previoustag.outputs.tag }} | ||
- name: 'Get New Version' | ||
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 | ||
uses: CumulusDS/[email protected] | ||
with: | ||
name: "Get New Version" | ||
uses: CumulusDS/[email protected] | ||
with: | ||
file: pubspec.yaml | ||
version_name: version | ||
- name: 'Print New Version' | ||
run: echo ${{ steps.config.outputs.version_name }} | ||
- name: 'Compare Vresion' | ||
if: steps.config.outputs.version_name == steps.previoustag.outputs.tag | ||
- | ||
name: "Print New Version" | ||
run: "echo ${{ steps.config.outputs.version_name }}" | ||
- | ||
if: "steps.config.outputs.version_name == steps.previoustag.outputs.tag" | ||
name: "Compare Vresion" | ||
run: | | ||
echo 'The version from your pubspec.yaml is the same as Release, Please update the version' | ||
exit 1 | ||
- shell: bash | ||
run: | | ||
echo ${{ steps.config.outputs.version_name }} > version.txt | ||
- name: 'Upload New Version' | ||
- | ||
run: "echo ${{ steps.config.outputs.version_name }} > version.txt\n" | ||
shell: bash | ||
- | ||
name: "Upload New Version" | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
with: | ||
name: home | ||
path: version.txt | ||
|
||
publish: | ||
needs: [check_version] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
path: version.txt | ||
publish: | ||
needs: | ||
- check_version | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: 'Publish Package' | ||
- | ||
name: "Publish Package" | ||
uses: ilteoood/actions-flutter-pub-publisher@master | ||
with: | ||
credential: ${{secrets.CREDENTIAL_JSON}} | ||
with: | ||
credential: "${{secrets.CREDENTIAL_JSON}}" | ||
dry_run: false | ||
flutter_package: true | ||
skip_test: true | ||
dry_run: false | ||
|
||
tag: | ||
needs: [publish] | ||
name: 'Tag Version' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Download New Version' | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: home | ||
- name: Set and Tag the new version | ||
shell: bash | ||
run: echo "::set-env name=RELEASE_VERSION::$(cat home/version.txt)" | ||
- uses: tvdias/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
tag: ${{env.RELEASE_VERSION}} | ||
tag: | ||
name: "Tag Version" | ||
needs: | ||
- publish | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- | ||
name: "Download New Version" | ||
uses: actions/download-artifact@v1 | ||
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/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
tag: "${{env.RELEASE_VERSION}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters