diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f04f661 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: NPM Package Release + +on: + pull_request: + branches: + - main + - develop + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Use checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Use setup-node + uses: actions/setup-node@v4 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - name: Install dependencies + run: npm ci + - name: Build + run: | + chmod +x package.sh + ./package.sh + env: + TRAVIS_TAG: ${{ github.event.release.tag_name }} + - name: npm publish + if: ${{ github.event_name == 'release' }} + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Upload assets + if: ${{ github.event_name == 'release' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/pos.js + asset_name: pos.js + asset_content_type: text/javascript diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 68af709..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: node_js -os: linux -dist: xenial -node_js: - - stable - -script: echo "We don't have tests yet :(" - -before_deploy: - - sh package.sh - -deploy: - - provider: releases - skip_cleanup: true - name: "$TRAVIS_TAG" - token: - secure: KYLrM5ne4DcXyeT1Cj/7yCeti9WQkfhREU1zUKmRY4u+5PH9WmKZBL6y1rJKRAqE2rr2HzxM+AxutjPF6ibPCqf/01rIlY5Kk/Bh7rV9SfHk2sjA/UqTtShI1kWFoGEF6tVKM8IyQ8ol7I/ZCwoq1dIm7CdDOOxLbvIT7Q/heptYewnCsvElIi7ILebxtwj55Xdvb95TPrZfgdsg5J+1NzHpZNcbXO++txgGPtKpY2ed9XKgF+FvnR6EEetSMtp1onm3hg+rqdQ7Sk0qxlNuOu0Dsovh5/PPrJyd6KtZwLbkS/DjPxd155kUS81RvsWlLr/jlpdzNmHP0lcWb5iUFxQrELHrkQ5USv/WxTP2G3mIr2gmS6is6AqlXhjNsMeOQdKQ1IZtWWj5uxnn3kQtn1oLHjy0hsgdvdTG/mxj9+8bsF3dqJsdVVmL66zn9SQUSzbk8DTGNianvyk/HyR9JS5LbHVyzSBroQHzgcCs9LmMWeUca59y/b/kqR5bfJPW5eQMZA+PvjaAGy/E18gmDPkjzgkzHHkCDL6QuoyQZTsbEzN2cTWyn3HtTrzTrNJlbzpXg2ykC6sXlPS7a1NouwlFFVvPBBLo0vTl9gdFr3vIjB+QbKBNzs903vtwz7w8Q+3ctbHn+EXEuSJjkDYEgt8uVkkXSlLKrTpHJIlieeI= - file: dist/pos.js - on: - tags: true - repo: TransbankDevelopers/transbank-pos-sdk-web-js - - provider: npm - skip_cleanup: true - email: transbankdevelopers@continuum.cl - api_token: - secure: "iETf9mX4b0PZVK4gyYa7vl9GXSro2cCEimL93H3az6d8spj4t5Xh/cV1aD+nEsKyfuW6vQCMpT4lH8zNP1K0eTeuijZUIyjzzGeCUpHe+SXCXm4/F/eK8D8WjPquB9zgvXP6KQCWiPIB6tIAfRUqR8RzJC3AAydoy/EktBtzqz86mG3Bh/vODoIu4XZwKo8QwCq2CldQSsgiDzLg0AbCAkqNNlJ1VS7JVEufy2bFNumfdrR3qE4dXh6wO+ccINBWaRO/HQ8Ec7XH2ME+mTUKL7nJB9wstWx0My2yxNtBa3zSaqMwU1RFDYiIdt+rbxhp1Z9QV/8wB5jZK6OiGGmDtyjw187Bad4I6rzgW/F3ShH/Oc+eUobHn6RB55iXZK+sRHfHJM7sveYf/aFO+ToCW1eWE5+ZiW2y9ApdzfthgQt/ABxDIa1rn/mCmioVygwZ3Ro5tfkQ9TGXOKtUAoIxi3bb4cBVaa9F+Ofg7E+8zkujCgZKJQowbAaKzfezxL5zhVNUEMdVNERaMdzB7ZEgZGQVcmUff3ggfxswU/a+IcYNxh3yevdShosG1y9keNkOaHuQ4xUgw3hBBNEEoDoddtNAVoqkjI+RGHqlEAVbUIiQNq6i0luKd0Ja9pJ0xjXrbLyPn3wxnerKNO5qqj1zyS2HSNizw5bK6xrJUBSPZcs=" - on: - tags: true - repo: TransbankDevelopers/transbank-pos-sdk-web-js