From b809e6f750367c4c8051c67ef291f84326039342 Mon Sep 17 00:00:00 2001 From: Pierre Balzack <96387156+balzack@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:48:25 -0800 Subject: [PATCH 1/3] bundling source for openwrt --- .github/workflows/openwrt.yml | 85 +++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/openwrt.yml diff --git a/.github/workflows/openwrt.yml b/.github/workflows/openwrt.yml new file mode 100644 index 00000000..dfe4f21c --- /dev/null +++ b/.github/workflows/openwrt.yml @@ -0,0 +1,85 @@ +name: CI + +on: + push: + branches: [ "openwrt" ] + pull_request: + branches: [ "openwrt" ] + +jobs: + + CI: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build React + run: | + npm install --global yarn + cd web + yarn install + yarn build + + - name: Bundle Webapp + uses: a7ul/tar-action@v1.1.0 + id: compress_webapp + with: + command: c + cwd: web + files: | + build + outPath: webapp.tar.gz + + - name: Bundle Server + uses: a7ul/tar-action@v1.1.0 + id: compress_server + with: + command: c + cwd: . + files: | + LICENSE + databag.db + go.mod + go.sum + main.go + internal + outPath: server.tar.gz + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.PUB_TOKEN }} + with: + tag_name: v1.0.1 + release_name: WebApp & Server Bundle + draft: false + prerelease: false + + - name: Upload Webapp Asset + id: upload-webapp + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: webapp.tar.gz + asset_name: webapp.tar.gz + asset_content_type: application/zip + + - name: Upload Server Asset + id: upload-server + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: server.tar.gz + asset_name: server.tar.gz + asset_content_type: application/zip + From 016a43ff89395ab1c06f24fc14c3dd88f058f3e9 Mon Sep 17 00:00:00 2001 From: Pierre Balzack <96387156+balzack@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:57:20 -0800 Subject: [PATCH 2/3] Update openwrt.yml --- .github/workflows/openwrt.yml | 43 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/.github/workflows/openwrt.yml b/.github/workflows/openwrt.yml index dfe4f21c..486c3eb0 100644 --- a/.github/workflows/openwrt.yml +++ b/.github/workflows/openwrt.yml @@ -50,36 +50,21 @@ jobs: internal outPath: server.tar.gz - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.PUB_TOKEN }} + - name: Upload Webapp to Tag + uses: svenstaro/upload-release-action@v2 with: - tag_name: v1.0.1 - release_name: WebApp & Server Bundle - draft: false - prerelease: false + repo_token: ${{ secrets.PUB_TOKEN }} + file: webapp.tar.gz + tag: v1.1.11 + overwrite: true + file_glob: true - - name: Upload Webapp Asset - id: upload-webapp - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PUB_TOKEN }} + - name: Upload Server to Tag + uses: svenstaro/upload-release-action@v2 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: webapp.tar.gz - asset_name: webapp.tar.gz - asset_content_type: application/zip - - - name: Upload Server Asset - id: upload-server - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: server.tar.gz - asset_name: server.tar.gz - asset_content_type: application/zip + repo_token: ${{ secrets.PUB_TOKEN }} + file: server.tar.gz + tag: v1.1.11 + overwrite: true + file_glob: true From 3d8355092136cdb5d81140d0e83b8665dc0eee43 Mon Sep 17 00:00:00 2001 From: Pierre Balzack <96387156+balzack@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:03:37 -0800 Subject: [PATCH 3/3] Update openwrt.yml --- .github/workflows/openwrt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/openwrt.yml b/.github/workflows/openwrt.yml index 486c3eb0..ec42277a 100644 --- a/.github/workflows/openwrt.yml +++ b/.github/workflows/openwrt.yml @@ -1,4 +1,4 @@ -name: CI +name: OpenWrt on: push: