-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.travis.yml
59 lines (59 loc) · 3.88 KB
/
.travis.yml
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
os: linux
dist: xenial
language: csharp
dotnet: 3.1.201
mono: none
env:
global:
- REPO_OWNER=$(echo $TRAVIS_BUILD_DIR | sed -r 's/\/.+//g')
jobs:
- RUNTIME=win-x64 OUTPUT_TYPE=Exe SELF_CONTAINED=false
- RUNTIME=win-x64 OUTPUT_TYPE=Exe SELF_CONTAINED=true
- RUNTIME=linux-x64 OUTPUT_TYPE=Exe SELF_CONTAINED=false
- RUNTIME=linux-x64 OUTPUT_TYPE=Exe SELF_CONTAINED=true
before-install:
- cd ~/build/${REPO_OWNER} && git clone https://github.com/clarkx86/common_ci-scripts.git && cd common_ci-scripts
- git checkout c1efd24ae26fd572cdc03575d3da5e0f588a9e43
- chmod +x ./*
- REPO_NAME=$(./get_repo-name.sh $TRAVIS_REPO_SLUG)
- TAG_CLEAN=$(./get_tag_clean.sh $(echo $TRAVIS_TAG | sed -E 's/\-\w+//'))
- TAG_SUFFIX=$(echo $TRAVIS_TAG | sed -r 's/.+\-//')
- ASSEMBLY_VERSION=$(./format_assembly-version.sh $TAG_CLEAN $TRAVIS_BUILD_NUMBER)
before-script:
- cd ~/build/${TRAVIS_REPO_SLUG}/src
script:
- ARTIFACT_SUFFIX=$(if [ "$SELF_CONTAINED" == "true" ]; then echo "-bundled"; elif [ "$OUTPUT_TYPE" == "Library" ]; then echo "-lib"; else echo ""; fi)
- ARTIFACT_NAME=${REPO_NAME}_${RUNTIME}${ARTIFACT_SUFFIX}_v${TAG_CLEAN}$(if [[ ! -z $TAG_SUFFIX ]]; then echo "-$TAG_SUFFIX"; fi)-${TRAVIS_BUILD_NUMBER}
- dotnet publish vellum.csproj -c Release -r ${RUNTIME} /property:Version=${ASSEMBLY_VERSION} /property:OutputType=${OUTPUT_TYPE} /p:PublishTrimmed=${SELF_CONTAINED} --self-contained ${SELF_CONTAINED} $(if [[ ! -z $TAG_SUFFIX ]]; then echo "/p:DefineConstants=\"$(echo $TAG_SUFFIX | tr [:lower:] [:upper:])\""; fi)
before_deploy:
- cd bin/Release/netcoreapp3.1/${RUNTIME}/publish && zip ${ARTIFACT_NAME}.zip ./*
- wget -q https://github.com/${TRAVIS_REPO_SLUG}/releases/download/${TRAVIS_TAG}/sha256sums.txt || true
deploy:
provider: releases
token:
secure: "bkpf8FnXooiKvbjgm/5kFV6y+5Apgi6sQm1iIdOfRTF4dkAdJG/p0fATFoR1V8HINIF9gN2bV7HefQz3UbgspbawPE/DK+HcHj1gHSjZ7QiabTSX4PgM5KfV0q54abIyot5kfyf+fj5RRrEsARFeDVpIi+B/VnyKJKb+5X9uTG8CzS1w4Afacjfh4gGFAW1aBAue/Oii96u42SZGk/gDX62kYUoiG1RXcx8acYSJOG241RfqiXN3zxZorhxItBLlAJUdC9n2FXPVw9awi/Joc643SE8TdBcqcggLKBieX8NVIk1YPIipanPZsubGafje78cqiMVquAxpq3BBamJEzKy4UPbW9SzI9/pkQtDuoaG6RvbtEjobKVKsKLeaP/uXE3fVorTeIpdNKmqkbag9yG0gOMu6JHkfEZCOHDBQXYSo22bevzO9dcWP8VmYwreaiUfYoZB3i+VEvZHH1k3ymEr4ckKchrg+/Enkj1SwzdDNdgl6PWsVt6Di+I8IMSMQ/Zqh3p6IhFWaX6WwIMbGcK2wkN1eqGg/aGfXCHoTatBi55zRYfvY3NlMzkuHX7Gn1Bf7Su6GR4NfBD7PbweQDI6dXO5bqfst9Dvq2a57SaDeRBzKtrPHWZ50ri3ppImucIUZmus4dCJlJSr2f1FVublzF2lI7EJI3u5eb8f7KH4="
file:
- ${ARTIFACT_NAME}.zip
skip_cleanup: true
on:
repo: clarkx86/vellum
tags: true
jobs:
include:
- if: tag IS present
env:
- secure: "WPihvGloAthhzpooE4uldwIVK6djl71CMQOj7AkfSMoZEPruV9kShIU1hipB7rH9Ek6+IbrdV4aajAKMzSGC6vlK2dhGDeSyuKmngcmffZzpW3dWahQT0GUxKXjzNPszyi7Gcln1L57l0oofTk4ScOKg1C6Nuzze/tKYxwzP1Ex1YG0JaQrNyCBfvOpw+b+oSl6UmFS30Sj+1EWfWFfdXP4Jn9k9zYEzdq+TsCY3FAME2LT/XYftS8mq/rHvYu7hrZdJtxTt/cOjOsWLHErNMlcxXiq3Jv1ZCUl6MtKxkrb3vMKVjxTV/ikuPVpzQdZgtgNyEPLA2wuEZaGVHpKM96MEKb/GM/ImqyrgXog1msUgoImix12rvLGxGKT9FUFu1Il0d2J+621jDzgifK1JlmGV1ci+E72AQAhd0ELAGTzEkR/8N1YFIhbUDkDTWfZSFMJWuV8JsIxaexNdM3JU+iS3BNGFV6xQBnWp+Gb4uxegJI/TgiWr3VqTN9Mfj1eBrcH4MZ9+pQciC90nB5zxdNT157/5YvhVGjsOZ//kxTHOw03fRzN1S2zwjzB1FUWKNf3Dsk3voLMgpIAe9pn5wL/bBLIRG5IfTpXrrQ3AqPKCuBGWKbScjp5xcv25XhpTQ5cOAXLHWu4sCJzipy+FOAVfb15GNa/IBX3CIWFFCWE="
- OUTPUT_TYPE=Library
script:
- ARTIFACT_NAME=${REPO_NAME}.${TAG_CLEAN}$(if [[ ! -z $TAG_SUFFIX ]]; then echo $(echo $TAG_SUFFIX | sed -r 's/[^ab]\w+//'); fi)
- dotnet pack -c Release /property:Version=${TAG_CLEAN} /property:OutputType=${OUTPUT_TYPE}
before_deploy:
- cd bin/Release/
deploy:
provider: script
skip_cleanup: true
script: dotnet nuget push "${ARTIFACT_NAME}.nupkg" --api-key $API_KEY --source https://api.nuget.org/v3/index.json
on:
repo: clarkx86/vellum
branch: master
tags: true