ci test
[platform/core/csapi/tizenfx.git] / .github / workflows / deploy-packages.yml
1 name: "Deploy Packages"
2
3 on:
4   workflow_dispatch:
5     inputs:
6       target:
7         description: 'Branch to deploy'
8         required: true
9         default: 'master'
10       deploy_to_myget:
11         description: 'Deploy packages to MyGet?'
12         required: true
13         default: true
14       deploy_to_tizen:
15         description: 'Submit changes to Tizen?'
16         required: true
17         default: true
18
19   # schedule:
20   # - cron: "0 16 * * *"
21
22 env:
23   TARGET_BRANCH: ${{ github.event.inputs.target }}
24
25 jobs:
26   test:
27     runs-on: ubuntu-latest
28     steps:
29     - uses: actions/checkout@v2
30       with:
31         ref: ${{ env.TARGET_BRANCH }}
32         fetch-depth: 0
33
34     - name: Get Branch Metadata
35       id: metadata
36       uses: TizenAPI/tizenfx-build-actions/branch-metadata@master
37       with:
38         ref: ${{ env.TARGET_BRANCH }}
39
40     - name: Get Version
41       id: version
42       env:
43         VERSION_PREFIX: ${{ steps.metadata.outputs.version-prefix }}
44       run: |
45         VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
46         echo VERSION=$VERSION
47         echo "::set-output name=version::$VERSION"
48
49     - name: Build
50       env:
51         VERSION: ${{ steps.version.outputs.version }}
52       run: |
53         ./build.sh full
54         ./build.sh pack $VERSION
55
56     - name: Deploy NuGet packages to MyGet
57       if: github.event.inputs.deploy_to_myget == 'true'
58       env:
59         NUGET_SOURCE: https://tizen.myget.org/F/dotnet-test/api/v2/package
60         APIKEY: ${{ secrets.MYGET_APIKEY }}
61       run: |
62         dotnet nuget push Artifacts/*.nupkg -k $APIKEY -s $NUGET_SOURCE -t 3000
63
64     - name: Test
65       run: |
66         echo "${{ steps.version.outputs.version }}"
67