diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build-nightly-container.yml (renamed from .github/workflows/container-release.yml) | 19 | ||||
| -rw-r--r-- | .github/workflows/build-stable-container.yml | 81 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 69 | ||||
| -rw-r--r-- | .github/workflows/stale.yml | 13 |
4 files changed, 143 insertions, 39 deletions
diff --git a/.github/workflows/container-release.yml b/.github/workflows/build-nightly-container.yml index e44ac200..5ff3322f 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/build-nightly-container.yml @@ -1,4 +1,4 @@ -name: Build and release container +name: Build and release container directly from master on: push: @@ -23,19 +23,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Crystal - uses: crystal-lang/install-crystal@v1.8.0 - with: - crystal: 1.9.2 - - - name: Run lint - run: | - if ! crystal tool format --check; then - crystal tool format - git diff - exit 1 - fi - - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: @@ -58,7 +45,7 @@ jobs: images: quay.io/invidious/invidious tags: | type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + type=raw,value=master,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} labels: | quay.expires-after=12w @@ -83,7 +70,7 @@ jobs: suffix=-arm64 tags: | type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + type=raw,value=master,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} labels: | quay.expires-after=12w diff --git a/.github/workflows/build-stable-container.yml b/.github/workflows/build-stable-container.yml new file mode 100644 index 00000000..25571ed6 --- /dev/null +++ b/.github/workflows/build-stable-container.yml @@ -0,0 +1,81 @@ +name: Build and release container + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: quay.io/invidious/invidious + flavor: | + latest=false + tags: | + type=semver,pattern={{version}} + type=raw,value=latest + labels: | + quay.expires-after=12w + + - name: Build and push Docker AMD64 image for Push Event + uses: docker/build-push-action@v5 + with: + context: . + file: docker/Dockerfile + platforms: linux/amd64 + labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} + build-args: | + "release=1" + + - name: Docker meta + id: meta-arm64 + uses: docker/metadata-action@v5 + with: + images: quay.io/invidious/invidious + flavor: | + latest=false + suffix=-arm64 + tags: | + type=semver,pattern={{version}} + type=raw,value=latest + labels: | + quay.expires-after=12w + + - name: Build and push Docker ARM64 image for Push Event + uses: docker/build-push-action@v5 + with: + context: . + file: docker/Dockerfile.arm64 + platforms: linux/arm64/v8 + labels: ${{ steps.meta-arm64.outputs.labels }} + push: true + tags: ${{ steps.meta-arm64.outputs.tags }} + build-args: | + "release=1" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 057e4d61..5f859613 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,10 +38,10 @@ jobs: matrix: stable: [true] crystal: - - 1.7.3 - - 1.8.2 - - 1.9.2 - - 1.10.1 + - 1.12.1 + - 1.13.2 + - 1.14.0 + - 1.15.0 include: - crystal: nightly stable: false @@ -51,6 +51,11 @@ jobs: with: submodules: true + - name: Install required APT packages + run: | + sudo apt install -y libsqlite3-dev + shell: bash + - name: Install Crystal uses: crystal-lang/install-crystal@v1.8.0 with: @@ -59,7 +64,9 @@ jobs: - name: Cache Shards uses: actions/cache@v3 with: - path: ./lib + path: | + ./lib + ./bin key: shards-${{ hashFiles('shard.lock') }} - name: Install Shards @@ -71,14 +78,6 @@ jobs: - name: Run tests run: crystal spec - - name: Run lint - run: | - if ! crystal tool format --check; then - crystal tool format - git diff - exit 1 - fi - - name: Build run: crystal build --warnings all --error-on-warnings --error-trace src/invidious.cr @@ -90,10 +89,10 @@ jobs: - uses: actions/checkout@v4 - name: Build Docker - run: docker-compose build --build-arg release=0 + run: docker compose build --build-arg release=0 - name: Run Docker - run: docker-compose up -d + run: docker compose up -d - name: Test Docker run: while curl -Isf http://localhost:3000; do sleep 1; done @@ -124,4 +123,44 @@ jobs: - name: Test Docker run: while curl -Isf http://localhost:3000; do sleep 1; done + lint: + + runs-on: ubuntu-latest + + continue-on-error: true + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install Crystal + id: lint_step_install_crystal + uses: crystal-lang/install-crystal@v1.8.0 + with: + crystal: latest + + - name: Cache Shards + uses: actions/cache@v3 + with: + path: | + ./lib + ./bin + key: shards-${{ hashFiles('shard.lock') }}-${{ steps.lint_step_install_crystal.outputs.crystal }} + + - name: Install Shards + run: | + if ! shards check; then + shards install + fi + + - name: Check Crystal formatter compliance + run: | + if ! crystal tool format --check; then + crystal tool format + git diff + exit 1 + fi + - name: Run Ameba linter + run: bin/ameba diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 16d3269b..498a2c1b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,14 +13,11 @@ jobs: - uses: actions/stale@v8 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 365 - days-before-pr-stale: 90 - days-before-close: 30 - exempt-pr-labels: blocked,exempt-stale + days-before-stale: 730 + days-before-pr-stale: -1 + days-before-close: 60 stale-issue-message: 'This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.' - stale-pr-message: 'This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked.' stale-issue-label: "stale" - stale-pr-label: "stale" ascending: true - # Never mark feature requests/enhancements as stale - exempt-issue-labels: "feature-request,enhancement,exempt-stale" + # Exempt the following types of issues from being staled + exempt-issue-labels: "feature-request,enhancement,discussion,exempt-stale" |
