From b29be73e581deafb39f0e4aec37286426c8586d5 Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sat, 10 Aug 2024 16:05:02 +1000 Subject: [PATCH 01/10] install --- .github/workflows/install-sqlx-ts.yaml | 104 +++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/install-sqlx-ts.yaml diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml new file mode 100644 index 00000000..9639a5d1 --- /dev/null +++ b/.github/workflows/install-sqlx-ts.yaml @@ -0,0 +1,104 @@ +name: Install +#on: +# release: +# types: [created] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + assets: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # Include all "Tier 1 with Host Tools" targets and "Tier 2 with Host Tools" targets for Windows and macOS, + # excluding *-pc-windows-msvc, which requires cross-toolchains. Goal is one option per OS per architecture. + # https://doc.rust-lang.org/rustc/platform-support.html + # https://github.com/cross-rs/cross#supported-targets + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + include: + # 32-bit (i686) + # i686-apple-darwin is Tier 3. + - build: linux-32-bit + os: ubuntu-latest + target: i686-unknown-linux-gnu + command: cross + - build: windows-32-bit + os: ubuntu-latest + target: i686-pc-windows-gnu + command: cross + # 64-bit (x86) + - build: linux-64-bit + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + command: cross + - build: macos-64-bit + os: macos-latest + target: x86_64-apple-darwin + command: cargo + - build: windows-64-bit + os: ubuntu-latest + target: x86_64-pc-windows-gnu + command: cross + # 64-bit (ARM) + # aarch64-pc-windows-gnullvm is Tier 3. + - build: macos-arm + os: macos-latest + target: aarch64-apple-darwin + command: cargo + - build: linux-arm + os: ubuntu-latest + target: aarch64-unknown-linux-gnu + command: cross + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - name: Install packages (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + ci/ubuntu-install-packages + - run: cargo install cross --git https://github.com/cross-rs/cross + - run: ${{ matrix.command }} build --release --target ${{ matrix.target }} + - run: ls target + + - name: Build archive + shell: bash + run: | + DIRECTORY="sqlx-ts-${{ github.event.release.tag_name }}-${{ matrix.build }}" + if [[ "${{ matrix.target }}" =~ "-pc-windows-" ]]; then + SUFFIX=".exe" + else + SUFFIX="" + fi + mkdir "$DIRECTORY" + cp "target/${{ matrix.target }}/release/sqlx-ts$SUFFIX" "$DIRECTORY" + 7z a "$DIRECTORY.zip" "$DIRECTORY" + echo "ASSET=$DIRECTORY.zip" >> $GITHUB_ENV + + - name: Upload release archive + uses: softprops/action-gh-release@v1 + with: + files: | + ${{ env.ASSET }} + + node: + needs: assets + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./node + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - run: npm i + - run: npm publish -f + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From eed56fefb30b52359c47966d2332b12ea5cecd63 Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 21:51:41 +1000 Subject: [PATCH 02/10] install windows --- .github/workflows/install-sqlx-ts.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index 9639a5d1..92da9723 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -1,7 +1,5 @@ name: Install -#on: -# release: -# types: [created] + on: push: branches: [ main ] From 58602359f95afa6a679864f6bbdcb70566884370 Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 21:52:37 +1000 Subject: [PATCH 03/10] test --- .github/workflows/install-sqlx-ts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index 92da9723..027a5c78 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -2,7 +2,7 @@ name: Install on: push: - branches: [ main ] + branches: [ windows-installation ] pull_request: branches: [ main ] From a97286b1a97d9c3f6a5364288b0f232acb2798fb Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 21:58:28 +1000 Subject: [PATCH 04/10] test --- .github/workflows/install-sqlx-ts.yaml | 52 ++------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index 027a5c78..8c95dbf7 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - assets: + install: runs-on: ${{ matrix.os }} strategy: matrix: @@ -52,51 +52,7 @@ jobs: command: cross steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable + - name: Use Node.js + uses: actions/setup-node@v4 with: - targets: ${{ matrix.target }} - - name: Install packages (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | - ci/ubuntu-install-packages - - run: cargo install cross --git https://github.com/cross-rs/cross - - run: ${{ matrix.command }} build --release --target ${{ matrix.target }} - - run: ls target - - - name: Build archive - shell: bash - run: | - DIRECTORY="sqlx-ts-${{ github.event.release.tag_name }}-${{ matrix.build }}" - if [[ "${{ matrix.target }}" =~ "-pc-windows-" ]]; then - SUFFIX=".exe" - else - SUFFIX="" - fi - mkdir "$DIRECTORY" - cp "target/${{ matrix.target }}/release/sqlx-ts$SUFFIX" "$DIRECTORY" - 7z a "$DIRECTORY.zip" "$DIRECTORY" - echo "ASSET=$DIRECTORY.zip" >> $GITHUB_ENV - - - name: Upload release archive - uses: softprops/action-gh-release@v1 - with: - files: | - ${{ env.ASSET }} - - node: - needs: assets - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./node - steps: - - uses: actions/checkout@v3 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v3 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' - - run: npm i - - run: npm publish -f - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + node-version: '20.x' From a558913d7459ffb5346cd9566ab81abd577b6c06 Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 22:02:03 +1000 Subject: [PATCH 05/10] install sqlx-ts --- .github/workflows/install-sqlx-ts.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index 8c95dbf7..bf88dc17 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -56,3 +56,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20.x' + - name: Install sqlx-ts + uses: bahmutov/npm-install@v1 + with: + install-command: 'npm install -g sqlx-ts' From 1304eee56d2f4a3b4af8c0e01c7988f5a104306a Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 22:25:39 +1000 Subject: [PATCH 06/10] hrmm --- .github/workflows/install-sqlx-ts.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index bf88dc17..d0cada9a 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -57,6 +57,4 @@ jobs: with: node-version: '20.x' - name: Install sqlx-ts - uses: bahmutov/npm-install@v1 - with: - install-command: 'npm install -g sqlx-ts' + run: npm install -g sqlx-ts From cd1d2e8da2a182d45d3c3908881f5c93141fb90a Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 22:28:00 +1000 Subject: [PATCH 07/10] hrm --- .github/workflows/install-sqlx-ts.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index d0cada9a..490d823f 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -58,3 +58,7 @@ jobs: node-version: '20.x' - name: Install sqlx-ts run: npm install -g sqlx-ts + - name: run sqlx-ts help + run: sqlx-ts --help + - name: run sqlx-ts version + run: sqlx-ts --version From 490c9ea83eddd2052cfac45b01714b61ef63af87 Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 22:48:29 +1000 Subject: [PATCH 08/10] hrm --- .github/workflows/install-sqlx-ts.yaml | 52 ++++++++++---------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index 490d823f..9065cad8 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -17,39 +17,22 @@ jobs: # https://github.com/cross-rs/cross#supported-targets # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources include: - # 32-bit (i686) - # i686-apple-darwin is Tier 3. - - build: linux-32-bit - os: ubuntu-latest - target: i686-unknown-linux-gnu - command: cross - - build: windows-32-bit - os: ubuntu-latest - target: i686-pc-windows-gnu - command: cross - # 64-bit (x86) - - build: linux-64-bit - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - command: cross - - build: macos-64-bit - os: macos-latest - target: x86_64-apple-darwin - command: cargo - - build: windows-64-bit - os: ubuntu-latest - target: x86_64-pc-windows-gnu - command: cross - # 64-bit (ARM) - # aarch64-pc-windows-gnullvm is Tier 3. - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - command: cargo - - build: linux-arm - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - command: cross + - os: ubuntu-latest + shell: sh + - os: ubuntu-latest + shell: bash + - os: macos-latest + shell: sh + - os: macos-latest + shell: bash + - os: windows-latest + shell: sh + - os: windows-latest + shell: bash + - os: windows-latest + shell: pwsh + - os: windows-latest + shell: PowerShell steps: - uses: actions/checkout@v3 - name: Use Node.js @@ -57,8 +40,11 @@ jobs: with: node-version: '20.x' - name: Install sqlx-ts + shell: ${{ matrix.shell }} run: npm install -g sqlx-ts - name: run sqlx-ts help + shell: ${{ matrix.shell }} run: sqlx-ts --help - name: run sqlx-ts version + shell: ${{ matrix.shell }} run: sqlx-ts --version From f345c04bd3741e71ac425968329b034935bd996e Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 22:53:42 +1000 Subject: [PATCH 09/10] hrm --- .github/workflows/install-sqlx-ts.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index 9065cad8..da5de06d 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -11,11 +11,6 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # Include all "Tier 1 with Host Tools" targets and "Tier 2 with Host Tools" targets for Windows and macOS, - # excluding *-pc-windows-msvc, which requires cross-toolchains. Goal is one option per OS per architecture. - # https://doc.rust-lang.org/rustc/platform-support.html - # https://github.com/cross-rs/cross#supported-targets - # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources include: - os: ubuntu-latest shell: sh @@ -40,11 +35,11 @@ jobs: with: node-version: '20.x' - name: Install sqlx-ts - shell: ${{ matrix.shell }} + shell: "${{ matrix.shell }}" run: npm install -g sqlx-ts - name: run sqlx-ts help - shell: ${{ matrix.shell }} + shell: "${{ matrix.shell }}" run: sqlx-ts --help - name: run sqlx-ts version - shell: ${{ matrix.shell }} + shell: "${{ matrix.shell }}" run: sqlx-ts --version From 9b17d14ba384a814629a48225d6ed93e41dee27f Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sun, 11 Aug 2024 23:09:36 +1000 Subject: [PATCH 10/10] fix --- .github/workflows/install-sqlx-ts.yaml | 79 ++++++++++++++++++++------ 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/.github/workflows/install-sqlx-ts.yaml b/.github/workflows/install-sqlx-ts.yaml index da5de06d..9be4f61d 100644 --- a/.github/workflows/install-sqlx-ts.yaml +++ b/.github/workflows/install-sqlx-ts.yaml @@ -7,27 +7,38 @@ on: branches: [ main ] jobs: - install: + install-bash: runs-on: ${{ matrix.os }} strategy: matrix: include: - os: ubuntu-latest - shell: sh - - os: ubuntu-latest - shell: bash - - os: macos-latest - shell: sh - os: macos-latest - shell: bash - - os: windows-latest - shell: sh - os: windows-latest - shell: bash - - os: windows-latest - shell: pwsh + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Install sqlx-ts + shell: bash + run: npm install -g sqlx-ts + - name: run sqlx-ts help + shell: bash + run: sqlx-ts --help + - name: run sqlx-ts version + shell: bash + run: sqlx-ts --version + + install-sh: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + - os: macos-latest - os: windows-latest - shell: PowerShell steps: - uses: actions/checkout@v3 - name: Use Node.js @@ -35,11 +46,47 @@ jobs: with: node-version: '20.x' - name: Install sqlx-ts - shell: "${{ matrix.shell }}" + shell: sh + run: npm install -g sqlx-ts + - name: run sqlx-ts help + shell: sh + run: sqlx-ts --help + - name: run sqlx-ts version + shell: sh + run: sqlx-ts --version + + install-pwsh: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Install sqlx-ts + shell: pwsh run: npm install -g sqlx-ts - name: run sqlx-ts help - shell: "${{ matrix.shell }}" + shell: pwsh run: sqlx-ts --help - name: run sqlx-ts version - shell: "${{ matrix.shell }}" + shell: pwsh run: sqlx-ts --version + + install-powershell: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Install sqlx-ts + shell: PowerShell + run: npm install -g sqlx-ts + - name: run sqlx-ts help + shell: PowerShell + run: sqlx-ts --help + - name: run sqlx-ts version + shell: PowerShell + run: sqlx-ts --version \ No newline at end of file