-
Notifications
You must be signed in to change notification settings - Fork 165
/
appveyor.yml
98 lines (89 loc) · 2.76 KB
/
appveyor.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
version: 6.0.{build}
skip_tags: true
skip_branch_with_pr: true
image: Visual Studio 2022
branches:
only:
- main
skip_commits:
files:
- .config/
- .github/
- examples/
- schemas/
- src/
environment:
nodejs_version: 18
npm_auth_token:
secure: utvTJFeOvz8YUfgc/z87ERaWZs4tDNSAe/atkmUagrQjaxniSCqXn0Q4U1UVx1ST
install:
- ps: Install-Product node $env:nodejs_version
- choco install jq
- ps: >-
npm install --loglevel=error
"//registry.npmjs.org/:_authToken=$env:npm_auth_token`n" | out-file "$env:userprofile\.npmrc" -Encoding ASCII
- choco install dart-sdk
- refreshenv
build_script:
- mkdir -p dist
- copy README.md dist\
- copy package.json dist\
- copy data\bancos.json dist\
- cd dist
- git config user.email "[email protected]"
- git config user.name "AppVeyor"
- npm version %APPVEYOR_BUILD_VERSION% -m 'v%APPVEYOR_BUILD_VERSION%'
- npm publish
- cd ..
- cmd: nuget pack BancosBrasileiros.nuspec -Version %APPVEYOR_BUILD_VERSION%
- ps: $response=Invoke-RestMethod 'https://api.github.com/repos/guibranco/bancosbrasileiros/actions/artifacts?name=releaseNotesFile'
- ps: $releaseNotesUrl=$response.artifacts[0].archive_download_url
- ps: $headers = @{Authorization = "Bearer $env:GITHUB_TOKEN"}
- ps: Invoke-WebRequest -Uri $releaseNotesUrl -OutFile release-notes.zip -Headers $headers
- 7z x release-notes.zip
- ps: $env:release_notes=(Get-Content -Path "$pwd\release-notes.md" -Encoding UTF8 -Raw) -replace '\n', '\n'
- mkdir dart
- cd dart
- copy ..\analysis_options.yaml .
- copy ..\LICENSE .
- copy ..\pubspec.yaml .
- copy ..\README.md .
- mkdir example
- copy ..\examples\dart\bancos_brasileiros_example.dart example\
- mkdir assets
- copy ..\data\bancos.json assets\
- mkdir lib
- copy ..\lib\bancos_brasileiros.dart lib\
- cd lib
- mkdir src
- copy ..\..\lib\src\*.dart src\
- cd ..
- mkdir test
- copy ..\test\bancos_brasileiros_test.dart test\
- cd test
- mkdir resources
- copy ..\..\test\resources\*.json resources\
- cd ..
- ps: >-
(Get-Content '.\pubspec.yaml') -replace "version: 1.0.0", "version: $env:APPVEYOR_BUILD_VERSION" | out-File '.\pubspec.yaml' -Encoding ASCII
- echo "## [%APPVEYOR_BUILD_VERSION%] - %RELEASE_NOTES%" > CHANGELOG.md
- C:\tools\dart-sdk\bin\dart pub get
- C:\tools\dart-sdk\bin\dart test
- C:\tools\dart-sdk\bin\dart pub publish --dry-run
artifacts:
- path: '**\*nupkg'
name: Package
deploy:
- provider: NuGet
api_key: $(NUGET_TOKEN)
skip_symbols: false
on:
branch: main
- provider: GitHub
on:
branch: main
tag: v$(appveyor_build_version)
description: 'Release of Bancos Brasileiros - v$(appveyor_build_version) \n$(release_notes)'
auth_token: $(GITHUB_TOKEN)
force_update: true
artifact: Package