-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (63 loc) · 2.08 KB
/
Copy pathpublish-to-pub.yaml
File metadata and controls
64 lines (63 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Publish package to pub.dev
on:
workflow_dispatch:
branches:
- master
inputs:
changeLog:
description: "Content for the ChangeLog file"
required: false
default: "Version Update"
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
with:
flutter-version: '1.22.4'
channel: 'stable'
- name: Set version as env variable
run: |
echo "VERSION=8.0.$(date +'%Y%m%d%H')" >> $GITHUB_ENV
- name: Echo version number
run: echo $NOW
- name: Update version
working-directory: ./mobilefoundation
run: |
flutter pub global activate cider
flutter pub global run cider:cider version $VERSION
- name: Update version
working-directory: ./mobilefoundation
run: |
echo "Updating the change log"
echo -e "\n## ${VERSION}" >> CHANGELOG.md
echo -e "\n* ${{ github.event.inputs.changeLog }}" >> CHANGELOG.md
if [[ -z $(git status -s) ]]
then
echo "No changes"
else
echo "Changes made, Commit needed"
git config user.name ${{ secrets.GH_USER }}
git config user.email "${{ secrets.GH_MAIL }}"
git branch
git add .
git commit -m "Updating version to $VERSION"
git push "https://${{ secrets.GH_TOKEN }}@github.com/MobileFirst-Platform-Developer-Center/mfp-client-flutter.git" HEAD:main
fi
- name: Setup credentials
working-directory: ./mobilefoundation
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1570721159347
}
EOF
- name: Publish package
working-directory: ./mobilefoundation
run: pub publish -f