From d1cc7e8cc5cb8e0afe8142193ce2ae941ffa7eaf Mon Sep 17 00:00:00 2001 From: Jon Musselwhite <35066367+FlippingBinary@users.noreply.github.com> Date: Sun, 2 Oct 2022 16:28:25 -0400 Subject: [PATCH 1/5] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...static-web-apps-salmon-coast-008650b0f.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml diff --git a/.github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml b/.github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml new file mode 100644 index 0000000..21cf943 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml @@ -0,0 +1,45 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - main + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_COAST_008650B0F }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/demo" # App source code path + api_location: "build/api" # Api source code path - optional + output_location: "build" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_COAST_008650B0F }} + action: "close" From 0152257376e6dcd065df1785deddde552f1b196b Mon Sep 17 00:00:00 2001 From: Jon Musselwhite <35066367+FlippingBinary@users.noreply.github.com> Date: Thu, 13 Oct 2022 19:06:10 -0400 Subject: [PATCH 2/5] fix: 'Could not resolve "./headers"' Fixes #83 --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index 7c64eb1..90b34ce 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ export default function ({ // use posix because of https://github.com/sveltejs/kit/pull/3200 const relativePath = posix.relative(tmp, builder.getServerDirectory()); - builder.copy(join(files, 'entry.js'), entry, { + builder.copy(files, tmp, { replace: { SERVER: `${relativePath}/index.js`, MANIFEST: './manifest.js', @@ -75,8 +75,6 @@ export default function ({ })};\n` ); - builder.copy(join(files, 'api'), apiDir); - /** @type {BuildOptions} */ const default_options = { entryPoints: [entry], From 2ac5aab16ed98dec1f3be56384fcf01f8254c16a Mon Sep 17 00:00:00 2001 From: Jon Musselwhite <35066367+FlippingBinary@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:24:18 -0400 Subject: [PATCH 3/5] chore: delete unrelated file --- .github/workflows/release.yml | 40 ----------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index c61e8ef..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - uses: GoogleCloudPlatform/release-please-action@v2 - id: release - with: - release-type: node - bump-minor-pre-major: true # remove this to enable breaking changes causing 1.0.0 tag - - # The logic below handles the npm publication: - # The if statements ensure that a publication only occurs when a new release is created - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - persist-credentials: false - if: ${{ steps.release.outputs.release_created }} - - - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: 'https://registry.npmjs.org' - if: ${{ steps.release.outputs.release_created }} - - - run: npm install - if: ${{ steps.release.outputs.release_created }} - - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - if: ${{ steps.release.outputs.release_created }} From 00ca0d7d50a2212ebcc1eb22a066cd8840e79708 Mon Sep 17 00:00:00 2001 From: Jon Musselwhite <35066367+FlippingBinary@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:27:10 -0400 Subject: [PATCH 4/5] chore: restore line --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 90b34ce..de7523c 100644 --- a/index.js +++ b/index.js @@ -68,6 +68,8 @@ export default function ({ } }); + builder.copy(join(files, 'api'), apiDir); + writeFileSync( `${tmp}/manifest.js`, `export const manifest = ${builder.generateManifest({ From 17626523f4ad582c8f06df9a1637da28ad1ec703 Mon Sep 17 00:00:00 2001 From: Jon Musselwhite <35066367+FlippingBinary@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:42:01 -0400 Subject: [PATCH 5/5] chore: swap file --- ...static-web-apps-salmon-coast-008650b0f.yml | 45 ------------------- .github/workflows/release.yml | 40 +++++++++++++++++ 2 files changed, 40 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml b/.github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml deleted file mode 100644 index 21cf943..0000000 --- a/.github/workflows/azure-static-web-apps-salmon-coast-008650b0f.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Azure Static Web Apps CI/CD - -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - main - -jobs: - build_and_deploy_job: - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') - runs-on: ubuntu-latest - name: Build and Deploy Job - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_COAST_008650B0F }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: "/demo" # App source code path - api_location: "build/api" # Api source code path - optional - output_location: "build" # Built app content directory - optional - ###### End of Repository/Build Configurations ###### - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_COAST_008650B0F }} - action: "close" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d5616aa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + push: + branches: + - main + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + id: release + with: + release-type: node + bump-minor-pre-major: true # remove this to enable breaking changes causing 1.0.0 tag + + # The logic below handles the npm publication: + # The if statements ensure that a publication only occurs when a new release is created + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + persist-credentials: false + if: ${{ steps.release.outputs.release_created }} + + - uses: actions/setup-node@v1 + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + + - run: npm install + if: ${{ steps.release.outputs.release_created }} + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }}