diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b19f39e1..fe50d5ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,6 @@ name: Build Addon on: - push: - branches: - - main - paths: - - 'packages/**' - - 'package-lock.json' - - 'package.json' - - 'tsconfig.json' - - 'tsconfig.base.json' pull_request: branches: - main diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index 5c1e6aea..ba0a3771 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -1,62 +1,90 @@ -name: Deploy Docker image to GitHub Container Registry and Docker Hub +name: Build and Deploy Docker Images on: - push: - tags: - - 'v*' # Trigger on any tag that starts with 'v' - branches: - - main # Trigger on push to main branch + workflow_dispatch: + inputs: + ref: + description: Git Ref + required: true + type: string jobs: - docker: + build: + name: build runs-on: ubuntu-latest + permissions: + packages: write + contents: read steps: - # Checkout the repository - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 - - # Set up QEMU for multi-platform builds - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - # Set up Docker Buildx - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - # Log in to GitHub Container Registry (GHCR) - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + ref: ${{inputs.ref}} + token: ${{ secrets.GITHUB_TOKEN }} - # Log in to Docker Hub - - name: Log in to Docker Hub - if: startsWith(github.ref, 'refs/tags/v') + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - # Build and push Docker image to both GHCR and Docker Hub - - name: Build and push Docker image (tags) - if: startsWith(github.ref, 'refs/tags/v') - uses: docker/build-push-action@v6 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 with: - platforms: linux/amd64,linux/arm64 - push: true - tags: | - ghcr.io/viren070/aiostreams:${{ github.ref_name }} - ghcr.io/viren070/aiostreams:latest - docker.io/${{ secrets.DOCKERHUB_USERNAME }}/aiostreams:${{ github.ref_name }} - docker.io/${{ secrets.DOCKERHUB_USERNAME }}/aiostreams:latest + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - # Build and push Docker image to GHCR only for each commit to main branch - - name: Build and push Docker image (dev) - if: github.ref == 'refs/heads/main' && github.event_name == 'push' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Calculate Image Tags + env: + INPUT_REF: ${{inputs.ref}} + run: | + declare TAGS="" + case "${INPUT_REF}" in + v[0-9]*.[0-9]*.[0-9]*) + TAGS="${INPUT_REF}" + if [[ "$(git rev-parse origin/main)" = "$(git rev-parse "${INPUT_REF}")" ]]; then + TAGS="${TAGS} latest" + fi + ;; + [0-9]*.[0-9]*.[0-9]*-nightly) + TAGS="${INPUT_REF} nightly" + ;; + *) + echo "Invalid Input Ref: ${INPUT_REF}" + exit 1 + esac + + if [[ -z "${TAGS}" ]]; then + echo "Empty Tags!" + exit 1 + fi + + { + echo 'DOCKER_IMAGE_TAGS<> "${GITHUB_ENV}" + + cat "${GITHUB_ENV}" + + - name: Build & Push uses: docker/build-push-action@v6 with: + cache-from: type=gha + cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 push: true - tags: ghcr.io/viren070/aiostreams:dev + context: . + file: ./Dockerfile + tags: ${{env.DOCKER_IMAGE_TAGS}} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..308c5622 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,64 @@ +name: Nightly Builds + +on: + push: + branches: [main] + paths: + - 'packages/**' + - 'package-lock.json' + - 'package.json' + - 'tsconfig.json' + - 'tsconfig.base.json' + - 'Dockerfile' + +jobs: + release: + name: release + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + permissions: + actions: write + contents: write + pull-requests: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate timestamp tag + id: gen_tag + run: | + TIMESTAMP=$(date '+%Y.%m.%d.%H%M-nightly') + echo "tag_name=$TIMESTAMP" >> $GITHUB_OUTPUT + + - name: Create git tag + env: + TAG_NAME: ${{ steps.gen_tag.outputs.tag_name }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag $TAG_NAME + git push origin $TAG_NAME + + - name: Get commit message + id: commit_msg + run: | + COMMIT_MSG=$(git log -1 --pretty=%B) + echo "commit_msg<> $GITHUB_OUTPUT + echo "$COMMIT_MSG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create GitHub prerelease + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "${{ steps.gen_tag.outputs.tag_name }}" \ + --repo "${GITHUB_REPOSITORY}" \ + --title "${{ steps.gen_tag.outputs.tag_name }}" \ + --notes "${{ steps.commit_msg.outputs.commit_msg }}" \ + --prerelease + + - name: Trigger Docker Image Publish + env: + GH_TOKEN: ${{ github.token }} + run: | + gh workflow run --repo ${GITHUB_REPOSITORY} deploy-docker.yml -f ref=${{ steps.gen_tag.outputs.tag_name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..eac1f66a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + release: + name: release + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + permissions: + actions: write + contents: write + pull-requests: write + steps: + - name: Release + id: release + uses: google-github-actions/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} + + - name: Trigger Docker Image Publish + if: ${{ steps.release.outputs['release_created'] }} + env: + GH_TOKEN: ${{ github.token }} + TAG_NAME: ${{ steps.release.outputs.tag_name }} + run: | + gh workflow run --repo ${GITHUB_REPOSITORY} deploy-docker.yml -f ref=${TAG_NAME} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..397c4203 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.22.0" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 491fab41..c227547f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,9 @@ # Changelog -All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. - -## [1.14.2](https://github.com/Viren070/aiostreams/compare/v1.14.1...v1.14.2) (2025-03-18) +## [1.22.0](https://github.com/Viren070/AIOStreams/compare/v1.21.1...v1.22.0) (2025-05-22) -### Bug Fixes +### Features -* attempt to fix release.yml ([960de88](https://github.com/Viren070/aiostreams/commit/960de88cc59304bde772be86d75e2ab88b48d1b6)) -* **easynews-plus:** encode easynews credentials ([71f2ad4](https://github.com/Viren070/aiostreams/commit/71f2ad434fa0bbbfaf93ec489b48752d8ee6f3a1)) -* **easynews:** encode easynews credentials ([e8cd4a4](https://github.com/Viren070/aiostreams/commit/e8cd4a49a058f1b4035b23824cde490c2c598013)) -* extract config string for custom configs when determining whether to encrypt sensitive information ([57649f0](https://github.com/Viren070/aiostreams/commit/57649f07f657941abe3fefd01a2c5b7462b11382)) -* filter out zero counts from skip reasons in logs ([d0db4db](https://github.com/Viren070/aiostreams/commit/d0db4dbf91c415405702f8e64af901f97a60f5b4)) +* pass `baseUrl` in Easynews++ config and add optional `EASYNEWS_PLUS_PLUS_PUBLIC_URL`. ([b41e210](https://github.com/Viren070/AIOStreams/commit/b41e210c04777b349629dc98f28982bfb2e54886)) +* stremthru improvements ([#172](https://github.com/Viren070/AIOStreams/issues/172)) ([72b5ab6](https://github.com/Viren070/AIOStreams/commit/72b5ab648e511220d7ff8b4bf453db94bb952b30)) diff --git a/README.md b/README.md index 3453791c..1da295d4 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@

- Discord Server + Discord Server - version + version GitHub Stars diff --git a/package-lock.json b/package-lock.json index eaa212d8..c7c15822 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11934,4 +11934,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/core/src/utils/env.ts b/packages/core/src/utils/env.ts index b64aaf51..55390366 100644 --- a/packages/core/src/utils/env.ts +++ b/packages/core/src/utils/env.ts @@ -675,6 +675,10 @@ export const Env = cleanEnv(process.env, { default: 'https://easynews-cloudflare-worker.jqrw92fchz.workers.dev/', desc: 'Easynews++ URL', }), + EASYNEWS_PLUS_PLUS_PUBLIC_URL: url({ + default: undefined, + desc: 'Easynews++ public URL', + }), DEFAULT_EASYNEWS_PLUS_PLUS_TIMEOUT: num({ default: undefined, desc: 'Default Easynews++ timeout', diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..7d21dead --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/refs/heads/main/schemas/config.json", + "release-type": "simple", + "bump-minor-pre-major": true, + "include-v-in-tag": true, + "packages": { + ".": { + "release-type": "node", + "include-component-in-tag": false, + "exclude-paths": [ + ".env.sample", + ".gitignore", + ".release-please-manifest.json", + "compose.yaml", + "release-please-config.json" + ], + "pull-request-title-pattern": "chore: release ${version}" + } + } +} \ No newline at end of file