diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7e347ba --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @coditory/reviewers \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..6cb8ab9 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,7 @@ +name: "Dependabot" + +on: pull_request_target + +jobs: + dependabot: + uses: coditory/workflows/.github/workflows/dependabot.yml@v1 diff --git a/.github/workflows/release-auto.yml b/.github/workflows/release-auto.yml new file mode 100644 index 0000000..0dbc374 --- /dev/null +++ b/.github/workflows/release-auto.yml @@ -0,0 +1,19 @@ +name: Release Auto + +on: + workflow_dispatch: + schedule: + # at 5:30 UTC every other month + - cron: "30 5 1 */2 *" + +jobs: + check: + uses: coditory/workflows/.github/workflows/release-auto-check.yml@v1 + secrets: inherit + + auto-release: + uses: ./.github/workflows/release.yml + secrets: inherit + if: needs.check.outputs.release == 'true' + needs: check + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..224fffa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + workflow_call: + inputs: + branch: + type: string + required: false + default: 'main' + increment-version: + type: boolean + required: false + default: false + workflow_dispatch: + inputs: + branch: + description: 'Branch to be used' + type: string + required: false + default: 'main' + increment-version: + description: 'Increment version' + type: boolean + required: false + default: false + +jobs: + release: + uses: coditory/workflows/.github/workflows/release-action.yml@v1 + secrets: inherit + with: + branch: ${{ inputs.branch }} + increment-version: ${{ inputs.increment-version }} diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..87d999c --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,15 @@ +# Development + +Development instructions. + +## Update latest version + +Update latest version only when there are backward compatible changes. + +``` +git commit -A -m "Fix XYZ" \ + && git push \ + && git tag v1 --force \ + && git push origin tag v1 --force +``` + diff --git a/README.md b/README.md new file mode 100644 index 0000000..9feb8f7 Binary files /dev/null and b/README.md differ diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..c0853bc --- /dev/null +++ b/action.yml @@ -0,0 +1,108 @@ +name: 'Coditory multi setup' +description: 'Single action to setup all kinds of environments for building projects.' +branding: + icon: play + color: blue +inputs: + # Java + java-version: + description: 'Java version' + required: false + java-distribution: + description: 'Java distribution' + required: false + default: 'temurin' + gradle-validate: + description: 'Validate gradle wrapper' + required: false + default: 'false' + gradle-dependency-graph: + description: 'Publish gradle dependency graph' + required: false + default: 'false' + # Go + go-version: + description: 'Go version' + required: false + # Node + node-version: + description: 'Go version' + required: false + # Python + python-version: + description: 'Python version' + required: false + # Rust + rust-toolchain: + description: 'Rust toolchain (e.g. nightly)' + required: false +runs: + using: "composite" + steps: + # Java + - name: Setup JDK + uses: actions/setup-java@v4 + if: inputs.java-version != '' + with: + java-version: ${{ inputs.java-version }} + distribution: ${{ inputs.java-distribution }} + + - name: Validate gradle wrapper + if: inputs.java-version != '' + uses: gradle/actions/wrapper-validation@v4 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + if: inputs.java-version != '' + with: + # Publish dependency graph only for the default branch + dependency-graph: | + ${{ inputs.gradle-dependency-graph }} == 'true' + && ${{ (github.event.repository != null && github.ref_name == github.event.repository.default_branch) + && 'generate-and-submit' || 'disabled' }} + + # Go + - name: Setup Go + uses: actions/setup-go@v5 + if: inputs.go-version != '' + with: + go-version: ${{ inputs.go-version }} + + # Node.js + - name: Setup Node.js + uses: actions/setup-node@v4 + if: inputs.node-version != '' + with: + node-version: ${{ inputs.node-version }} + cache: npm + + # Python + - name: Setup Python + uses: actions/setup-python@v5 + if: inputs.python-version != '' + with: + python-version: ${{ inputs.python-version }} + cache: 'pip' + + # Rust + - name: Install Rust + uses: actions-rs/toolchain@v1 + if: inputs.rust-toolchain != '' + with: + profile: minimal + toolchain: ${{ inputs.rust-toolchain }} + override: true + components: rustfmt, clippy + + - name: Set up cargo cache + uses: actions/cache@v4 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-