From 3cc2552d7150b8da725b54a21c5071781add48e7 Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Tue, 12 Dec 2023 02:02:17 +0100 Subject: [PATCH] sqlx: add devcontainer feature --- .github/workflows/devcontainer.yml | 30 +++++++++++++++++++ .../feature/sqlx/devcontainer-feature.json | 7 +++++ devcontainer/feature/sqlx/install.sh | 4 +++ 3 files changed, 41 insertions(+) create mode 100644 .github/workflows/devcontainer.yml create mode 100644 devcontainer/feature/sqlx/devcontainer-feature.json create mode 100755 devcontainer/feature/sqlx/install.sh diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml new file mode 100644 index 0000000..0b17147 --- /dev/null +++ b/.github/workflows/devcontainer.yml @@ -0,0 +1,30 @@ +name: Publish devcontainer stuff + +on: + push: + branches: + - "main" + paths: + - "devcontainer/**" + - ".github/workflows/devcontainer.yml" + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Log into Registry + uses: docker/login-action@v2 + with: + registry: ${{ vars.REGISTRY }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Publish features + uses: devcontainers/action@v1 + with: + publish-features: "true" + base-path-to-features: "./devcontainer/feature" + oci-registry: ${{ vars.REGISTRY }} diff --git a/devcontainer/feature/sqlx/devcontainer-feature.json b/devcontainer/feature/sqlx/devcontainer-feature.json new file mode 100644 index 0000000..33ed14f --- /dev/null +++ b/devcontainer/feature/sqlx/devcontainer-feature.json @@ -0,0 +1,7 @@ +{ + "id": "sqlx", + "version": "0.1.0", + "name": "SQLx", + "description": "Add the SQLx-cli", + "documentationURL": "https://github.com/launchbadge/sqlx" +} diff --git a/devcontainer/feature/sqlx/install.sh b/devcontainer/feature/sqlx/install.sh new file mode 100755 index 0000000..bb9534e --- /dev/null +++ b/devcontainer/feature/sqlx/install.sh @@ -0,0 +1,4 @@ +curl -sOL https://github.com/cargo-bins/cargo-quickinstall/releases/download/sqlx-cli-0.7.3-x86_64-unknown-linux-gnu/sqlx-cli-0.7.3-x86_64-unknown-linux-gnu.tar.gz +tar -xzf sqlx-cli-0.7.3-x86_64-unknown-linux-gnu.tar.gz +cp sqlx /usr/local/bin/ +rm sqlx cargo-sqlx sqlx-cli-0.6.3-x86_64-unknown-linux-gnu.tar.gz