Skip to content

feat(standardrb): update dependency standard to '~> 1.36.0' #1699

feat(standardrb): update dependency standard to '~> 1.36.0'

feat(standardrb): update dependency standard to '~> 1.36.0' #1699

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate-matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: prep
run: |
echo "matrix=$(./.github/bin/generate-matrix)" >>"$GITHUB_OUTPUT"
echo "matrix-ext=$(./.github/bin/generate-matrix external)" >>"$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.prep.outputs.matrix }}
matrix-ext: ${{ steps.prep.outputs.matrix-ext }}
test:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- id: prep
name: Prepare
run: |
image=restyled/restyler-${{ matrix.restyler }}:${{ github.sha }}
echo "image=$image" >> "$GITHUB_OUTPUT"
- name: Lint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.restyler }}/Dockerfile
failure-threshold: error
- id: buildx
name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Restore cache
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-${{ matrix.restyler }}-image-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.restyler }}-image-
- name: Registry login
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build
if: ${{ github.ref != 'refs/heads/main' }}
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ matrix.restyler }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
outputs: type=docker
tags: ${{ steps.prep.outputs.image }}
- name: Build and Push
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ matrix.restyler }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
push: true
tags: ${{ steps.prep.outputs.image }}
- name: Cache cleanup
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Container credentials
if: ${{ github.ref == 'refs/heads/main' }}
run: |
mkdir -p ~/work/_temp/_github_home/.docker
cp ~/.docker/config.json ~/work/_temp/_github_home/.docker/config.json
- name: Test
if: ${{ github.ref != 'refs/heads/main' }}
uses: restyled-io/sdk@main
with:
command: >-
restylers
--sha ${{ github.sha }}
--no-build
--write restyler.yaml
${{ matrix.restyler }}
${{ matrix.overrides }}
- name: Test and Push
if: ${{ github.ref == 'refs/heads/main' }}
uses: restyled-io/sdk@main
with:
command: >-
restylers
--sha ${{ github.sha }}
--no-build
--push
--write restyler.yaml
${{ matrix.restyler }}
${{ matrix.overrides }}
- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.restyler }}
path: restyler.yaml
test-external:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix-ext) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Test
uses: restyled-io/sdk@main
with:
command: >-
restylers
--sha ${{ github.sha }}
--no-build
--write restyler.yaml
${{ matrix.restyler }}
- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.restyler }}
path: restyler.yaml
# See https://github.com/orgs/community/discussions/60792
status:
needs: [test, test-external]
if: ${{ failure() || cancelled() }}
runs-on: ubuntu-latest
steps:
- run: |
echo "Some Restylers have failed or been cancelled"
exit 1
promote:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [test, test-external]
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/download-artifact@v4
- name: Build manifest
run: |
cat **/*.yaml > restylers.yaml
- name: Promote to sha tag
uses: restyled-io/sdk@main
with:
command: >-
promote --yes --no-test --file restylers.yaml ${{ github.sha }}
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [promote]
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- id: tag
name: Tag
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.tag.outputs.new_tag }}
release_name: Release ${{ steps.tag.outputs.new_tag }}
body: ${{ steps.tag.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Promote to version tag
uses: restyled-io/sdk@main
with:
command: >-
promote --yes --no-test ${{ github.sha }} ${{ steps.tag.outputs.new_tag }}
- name: Promote to dev
uses: restyled-io/sdk@main
with:
command: >-
promote --yes --no-test ${{ github.sha }} dev
- name: Notify
uses: zulip/github-actions-zulip/send-message@v1.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: ${{ secrets.ZULIP_EMAIL }}
organization-url: ${{ secrets.ZULIP_ORGANIZATION_URL }}
to: 'changelog'
type: 'stream'
topic: 'Restylers Releases'
content: |
Restylers [${{ steps.tag.outputs.new_tag }}](https://github.com/restyled-io/restylers/releases/tag/${{ steps.tag.outputs.new_tag }}) released to `dev` channel
${{ steps.tag.outputs.changelog }}
Commit: ${{ github.sha }}