1 name: "Deploy Packages"
7 description: 'Branch to deploy'
11 description: 'Deploy packages to Github Packages Registry?'
15 description: 'Deploy packages to MyGet?'
19 description: 'Submit changes to Tizen?'
24 TARGET_BRANCH: ${{ github.event.inputs.target }}
30 - uses: actions/checkout@v3
32 ref: ${{ env.TARGET_BRANCH }}
35 - uses: actions/setup-dotnet@v3
37 dotnet-version: '6.0.102'
41 git config --global user.name "TizenAPI-Bot"
42 git config --global user.email "tizenapi@samsung.com"
43 git config core.sshCommand "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
45 - name: Get Branch Metadata
47 uses: TizenAPI/tizenfx-build-actions/branch-metadata@master
49 ref: ${{ env.TARGET_BRANCH }}
54 VERSION_PREFIX: ${{ steps.metadata.outputs.version-prefix }}
56 VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
58 echo "version=$VERSION" >> $GITHUB_OUTPUT
62 VERSION: ${{ steps.version.outputs.version }}
65 ./build.sh pack $VERSION
69 VERSION: ${{ steps.version.outputs.version }}
71 git tag -fa "v$VERSION" -m "Release $VERSION"
72 git push -f --tags origin refs/tags/"v$VERSION"
74 - name: Install Github Package Registry Tool
75 if: github.event.inputs.deploy_to_gpr == 'true'
76 run: dotnet tool install --global --no-cache gpr
78 - name: Deploy NuGet packages to Github Packages Registry
79 if: github.event.inputs.deploy_to_gpr == 'true'
81 gpr push --api-key ${{ secrets.GITHUB_TOKEN }} \
82 --repository ${{ github.repository }} \
83 --retries 3 Artifacts/*.nupkg
85 - name: Deploy NuGet packages to MyGet
86 if: github.event.inputs.deploy_to_myget == 'true'
88 NUGET_SOURCE: https://tizen.myget.org/F/dotnet/api/v2/package
89 APIKEY: ${{ secrets.MYGET_APIKEY }}
91 dotnet nuget push Artifacts/*.nupkg -k $APIKEY -s $NUGET_SOURCE -t 3000
93 - name: Setup SSH private keys
94 uses: webfactory/ssh-agent@v0.7.0
96 ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
98 - name: Submit changes to Tizen
99 if: github.event.inputs.deploy_to_tizen == 'true'
101 VERSION: ${{ steps.version.outputs.version }}
102 GERRIT_BRANCH: ${{ steps.metadata.outputs.tizen-branch }}
103 GERRIT_URL: ssh://dotnetbuild@review.tizen.org:29418/platform/core/csapi/tizenfx
105 if [ -z "$GERRIT_BRANCH" ]; then
106 echo "## no specified tizen branch"
109 git remote add gerrit $GERRIT_URL
110 git fetch gerrit $GERRIT_BRANCH
111 git checkout -t gerrit/$GERRIT_BRANCH
112 git merge --no-edit -s recursive -X theirs origin/$TARGET_BRANCH
113 ./packaging/makespec.sh -r $VERSION -n $VERSION -i $VERSION
115 if [ $(git diff --cached --numstat | wc -l) -eq 0 ]; then
116 echo "## no changes to sync"
119 SUBMIT_TAG=submit/$GERRIT_BRANCH/$(date '+%Y%m%d.%H%M%S')
120 echo SUBMIT_TAG=$SUBMIT_TAG
121 git commit -m "Release $VERSION"
122 git tag -m "Release $VERSION" $SUBMIT_TAG
123 git push -f gerrit HEAD:$GERRIT_BRANCH
124 git push gerrit refs/tags/$SUBMIT_TAG
125 echo "::notice title=Submit Request TAG::$SUBMIT_TAG"