Skip to content

Commit

Permalink
feat: Config
Browse files Browse the repository at this point in the history
  • Loading branch information
dango2887 committed Aug 30, 2023
1 parent 62b54d5 commit 29f72eb
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/push_lib_widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: check
- name: 检查当前版本
id: generate_version
run: |
prev_version_1=$(grep "VERSION_NAME=" lib/widget/gradle.properties | sed -E 's/VERSION_NAME=([0-9]+)\.[0-9]+\.[0-9]+/\1/')
prev_version_2=$(grep "VERSION_NAME=" lib/widget/gradle.properties | sed -E 's/VERSION_NAME=[0-9]+\.([0-9]+)\.[0-9]+/\1/')
Expand All @@ -32,23 +33,9 @@ jobs:
fi
fi
formatted_version_1=$(printf "%d" "$new_version_1")
formatted_version_2=$(printf "%d" "$new_version_2")
formatted_version_3=$(printf "%d" "$new_version_3")
echo "new_version_1=$formatted_version_1" >> $GITHUB_OUTPUT
echo "new_version_2=$formatted_version_2" >> $GITHUB_OUTPUT
echo "new_version_3=$formatted_version_3" >> $GITHUB_OUTPUT
echo "Formatted Versions: $formatted_version_1, $formatted_version_2, $formatted_version_3"
- name: 检查当前版本
id: generate_version
run: |
# Generate a new version code based on the previous one
prev_version=$(grep "VERSION_NAME" lib/widget/gradle.properties | grep -o '[0-9]\+$')
new_version=$((prev_version + 1))
formatted_version=$(printf "%04d" "$new_version")
echo "$formatted_version"
echo "new_version=$formatted_version" >> $GITHUB_OUTPUT
formatted_version=$(printf "%s" "$formatted_version_1.$formatted_version_2.$formatted_version_3")
echo "new_version=formatted_version" >> $GITHUB_OUTPUT
echo "Formatted Versions: $formatted_version"
- name: 之前保存的版本号
run: |
echo "new_version = ${{ steps.generate_version.outputs.new_version }}"
Expand Down

0 comments on commit 29f72eb

Please sign in to comment.