|
| 1 | +name: OB Release workflow |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + example_input: |
| 7 | + description: 'An example input value' |
| 8 | + required: false |
| 9 | + default: 'default-value' |
| 10 | + # workflow_dispatch: |
| 11 | + # push: |
| 12 | + # branches: [ main, master ] |
| 13 | + # pull_request: |
| 14 | + # branches: [ main, master ] |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + |
| 19 | + |
| 20 | +jobs: |
| 21 | + manual-job: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + # environment: Prod |
| 24 | + # if: github.ref == 'refs/heads/octobot' && contains(fromJSON('["Herklos", "GuillaumeDSM"]'), github.actor) |
| 25 | + |
| 26 | + steps: |
| 27 | + # - name: Print Trigger Info |
| 28 | + # run: | |
| 29 | + # echo "This workflow was triggered manually." |
| 30 | + # echo "Input value: ${{ github.event.inputs.example_input }}" |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + # - name: Setup PHP with PECL extension |
| 33 | + # uses: shivammathur/setup-php@v2 |
| 34 | + # with: |
| 35 | + # php-version: '8.4.6' |
| 36 | + # # cache: true |
| 37 | + # ini-values: | |
| 38 | + # zend.assertions=1 |
| 39 | + # display_errors=On |
| 40 | + - uses: actions/setup-python@v5 |
| 41 | + with: |
| 42 | + python-version: '3.11' |
| 43 | + cache: 'pip' |
| 44 | + # - name: create usr/share/dotnet folder |
| 45 | + # run: | |
| 46 | + # sudo mkdir -p /usr/share/dotnet |
| 47 | + # - uses: actions/setup-dotnet@v4 |
| 48 | + # with: |
| 49 | + # dotnet-version: '9.0.x' |
| 50 | + # dotnet-quality: 'preview' |
| 51 | + # run: | |
| 52 | + # sudo mkdir -p /usr/share/dotnet |
| 53 | + - name: Install NPM dependencies |
| 54 | + run: npm ci |
| 55 | + # - name: Composer install |
| 56 | + # run: composer install |
| 57 | + - name: Install python dependencies |
| 58 | + run: pip install -r ci-requirements.txt |
| 59 | + - name: Install Wheel |
| 60 | + run: pip install wheel twine |
| 61 | + - name: Transpile and Build (JS + Python only) |
| 62 | + run: npm run force-build-js-py |
| 63 | + - name: Base tests Rest |
| 64 | + run: npm run test-base-rest-js-py |
| 65 | + - name: Base tests Ws |
| 66 | + run: npm run test-base-ws-js-py |
| 67 | + - name: Id tests |
| 68 | + run: npm run id-tests-js-py |
| 69 | + - name: Request tests |
| 70 | + run: npm run request-tests-js-py |
| 71 | + - name: Response tests |
| 72 | + run: npm run response-tests-js-py |
| 73 | + - name: CommonJs tests |
| 74 | + run: npm run commonjs-test |
| 75 | + - name: Package Test |
| 76 | + run: npm run package-test |
| 77 | + - name: Freshness Test |
| 78 | + run: npm run test-freshness |
| 79 | + # - name: Set new Version |
| 80 | + # run: | |
| 81 | + # npm config set git-tag-version=false |
| 82 | + # NEW_VERSION=$(./build/smart-bump.sh) |
| 83 | + # NPM_VERSION=$(npm version "$NEW_VERSION") |
| 84 | + # echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV |
| 85 | + # COMMIT_MESSAGE=${NPM_VERSION:1} |
| 86 | + # echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV |
| 87 | + # - name: Pull changes |
| 88 | + # run: | |
| 89 | + # git config --global user.name "github-actions[bot]" |
| 90 | + # git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 91 | + # git config --global pull.rebase false |
| 92 | + # git add go/ |
| 93 | + # git commit -m "[Automated changes] GO" |
| 94 | + # git pull -X ours origin master --no-edit |
| 95 | + # - name: Commit files |
| 96 | + # run: git add . -A |
| 97 | + # - name: Git status |
| 98 | + # run: git status |
| 99 | + # - name: cleanup old tags |
| 100 | + # run: npm run cleanup-old-tags --limit |
| 101 | + # - name: Generate Release Notes |
| 102 | + # env: |
| 103 | + # COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }} |
| 104 | + # GH_TOKEN: ${{ github.token }} |
| 105 | + # VERSION: ${{ env.NPM_VERSION }} |
| 106 | + # run: | |
| 107 | + # echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" |
| 108 | + # git config --global user.name "github-actions[bot]" |
| 109 | + # git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 110 | + # git commit -m "[Automated changes] ${COMMIT_MESSAGE}" |
| 111 | + # git push origin HEAD:master |
| 112 | + # git fetch --tags --depth=1 |
| 113 | + # PREVIOUS_TAG=$(git tag --sort=-creatordate | head -n1) |
| 114 | + # echo "Previous tag: ${PREVIOUS_TAG}" |
| 115 | + |
| 116 | + |
| 117 | + # git tag -a "go/${VERSION}" -m "${COMMIT_MESSAGE}" |
| 118 | + # git push origin "go/${VERSION}" |
| 119 | + |
| 120 | + # git tag -a "${VERSION}" -m "${COMMIT_MESSAGE}" |
| 121 | + # git push origin "${VERSION}" |
| 122 | + |
| 123 | + # echo "Creating GitHub release from ${VERSION}…" |
| 124 | + # gh release create "${VERSION}" --generate-notes --notes-start-tag "${PREVIOUS_TAG}" --verify-tag |
| 125 | + # - name: Publish Go node_modules |
| 126 | + # env: |
| 127 | + # VERSION: ${{ env.NPM_VERSION }} |
| 128 | + # run: | |
| 129 | + # cd go/ |
| 130 | + # GOPROXY=proxy.golang.org go list -m github.com/ccxt/ccxt/go/v4@$VERSION |
| 131 | + # cd .. |
| 132 | + # - name: C# Release Build |
| 133 | + # run: npm run buildCSRelease |
| 134 | + # - name: Deploy C# |
| 135 | + # env: |
| 136 | + # NUGGET_TOKEN: ${{ secrets.NUGET_PROD }} |
| 137 | + # run: ./cs/deploy.sh; |
| 138 | + - name: Deploy Python |
| 139 | + env: |
| 140 | + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
| 141 | + run: cd python && ./deploy.sh && cd ..; |
| 142 | +# todo restore npm publish later on |
| 143 | +# - uses: JS-DevTools/npm-publish@v3 |
| 144 | +# with: |
| 145 | +# token: ${{ secrets.NPM_PROD }} |
| 146 | +# # jobs: |
| 147 | +# manual-job: |
| 148 | +# runs-on: ubuntu-latest |
| 149 | +# if: github.ref == 'refs/heads/master' |
| 150 | +# steps: |
| 151 | +# - name: Print Trigger Info |
| 152 | +# run: | |
| 153 | +# echo "This workflow was triggered manually." |
| 154 | +# echo "Input value: ${{ github.event.inputs.example_input }}" |
| 155 | +# - uses: actions/checkout@v4 |
| 156 | +# with: |
| 157 | +# ssh-key: ${{secrets.SECRET_KEY}} |
| 158 | +# fetch-depth: 2 |
| 159 | +# - uses: actions/setup-node@v4 |
| 160 | +# with: |
| 161 | +# node-version: '20' |
| 162 | +# registry-url: "https://registry.npmjs.org" |
| 163 | +# - name: Setup PHP with PECL extension |
| 164 | +# uses: shivammathur/setup-php@v2 |
| 165 | +# with: |
| 166 | +# php-version: '8.1' |
| 167 | +# - uses: actions/setup-python@v5 |
| 168 | +# with: |
| 169 | +# python-version: '3.11' |
| 170 | +# cache: 'pip' |
| 171 | +# - name: create usr/share/dotnet folder |
| 172 | +# run: | |
| 173 | +# sudo mkdir -p /usr/share/dotnet |
| 174 | +# - uses: actions/setup-dotnet@v4 |
| 175 | +# with: |
| 176 | +# dotnet-version: '7.0.x' |
| 177 | +# dotnet-quality: 'preview' |
| 178 | +# run: | |
| 179 | +# sudo mkdir -p /usr/share/dotnet |
| 180 | +# - uses: actions/checkout@v4 |
| 181 | +# - name: Setup Go |
| 182 | +# uses: actions/setup-go@v5 |
| 183 | +# with: |
| 184 | +# go-version: "1.21.x" |
| 185 | +# - name: Install NPM dependencies |
| 186 | +# run: npm ci |
| 187 | +# - name: Composer install |
| 188 | +# run: composer install |
| 189 | +# - name: Install python dependencies |
| 190 | +# run: pip install -r ci-requirements.txt |
| 191 | +# - name: Install Wheel |
| 192 | +# run: pip install wheel twine |
| 193 | +# - name: export exchanges (remove later) |
| 194 | +# run: npm run export-exchanges |
| 195 | +# # # - name: Transpile and Build |
| 196 | +# # # run: npm run force-build |
| 197 | +# # - name: Base tests Rest |
| 198 | +# # run: npm run test-base-rest |
| 199 | +# # - name: Base tests Ws |
| 200 | +# # run: npm run test-base-ws |
| 201 | +# # - name: Id tests |
| 202 | +# # run: npm run id-tests |
| 203 | +# # - name: Request tests |
| 204 | +# # run: npm run request-tests |
| 205 | +# # - name: Response tests |
| 206 | +# # run: npm run response-tests |
| 207 | +# # # - name: CommonJs tests |
| 208 | +# # # run: npm run commonjs-test tmp disabling it |
| 209 | +# # - name: Package Test |
| 210 | +# # run: npm run package-test |
| 211 | +# # - name: Freshness Test |
| 212 | +# # run: npm run test-freshness |
| 213 | +# # - name: Go Types Test |
| 214 | +# # run: npm run test-types-go |
| 215 | +# # Will start the deployment process |
| 216 | +# - name: Set new Version |
| 217 | +# run: | |
| 218 | +# npm config set git-tag-version=false |
| 219 | +# NPM_VERSION=$(npm version patch) |
| 220 | +# echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV |
| 221 | +# COMMIT_MESSAGE=${NPM_VERSION:1} |
| 222 | +# echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV |
| 223 | +# - name: Pull changes |
| 224 | +# run: | |
| 225 | +# git config --global pull.rebase false |
| 226 | +# git pull origin master |
| 227 | +# - name: vss and copy python-files |
| 228 | +# run: npm run vss && npm run copy-python-files |
| 229 | +# - name: Commit files |
| 230 | +# run: git add . -A |
| 231 | +# - name: Git status |
| 232 | +# run: git status |
| 233 | +# - name: cleanup old tags |
| 234 | +# run: npm run cleanup-old-tags --limit |
| 235 | +# - name: Create GH Release and git-tag-version and push |
| 236 | +# env: |
| 237 | +# COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }} |
| 238 | +# NPM_VERSION: ${{ env.NPM_VERSION }} |
| 239 | +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 240 | +# run: | |
| 241 | +# echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" |
| 242 | +# git config --global user.name "github-actions[bot]" |
| 243 | +# git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 244 | +# git remote set-url origin https://${GITHUB_TOKEN}@github.com/${{ github.repository }} |
| 245 | +# git tag -a "${NPM_VERSION}" -m "${COMMIT_MESSAGE}" |
| 246 | +# git commit -m "${COMMIT_MESSAGE}" |
| 247 | +# git remote set-url origin https://${GITHUB_TOKEN}@github.com/${{ github.repository }} |
| 248 | +# git push --tags |
| 249 | +# echo "Creating github release..." |
| 250 | +# gh release create "${NPM_VERSION}" --generate-notes --verify-tag |
| 251 | +# git push origin HEAD:master |
| 252 | + |
| 253 | +# - name: Publish Go node_modules |
| 254 | +# env: |
| 255 | +# VERSION: ${{ env.NPM_VERSION }} |
| 256 | +# run: | |
| 257 | +# GOPROXY=proxy.golang.org go list -m github.com/ccxt/ccxt@$VERSION |
| 258 | +# - name: C# Release Build |
| 259 | +# run: npm run buildCSRelease |
| 260 | +# - name: Deploy C# |
| 261 | +# env: |
| 262 | +# NUGGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |
| 263 | +# run: ./cs/deploy.sh; |
| 264 | +# - name: Deploy Python |
| 265 | +# env: |
| 266 | +# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
| 267 | +# run: cd python && ./deploy.sh && cd ..; |
| 268 | +# - uses: JS-DevTools/npm-publish@v3 |
| 269 | +# with: |
| 270 | +# token: ${{ secrets.NPM_TOKEN }} |
0 commit comments