diff --git a/automation/greetings.yml b/automation/greetings.yml deleted file mode 100644 index 28ee6b2f11..0000000000 --- a/automation/greetings.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Message that will be displayed on users'' first issue' - pr-message: 'Message that will be displayed on users'' first pr' diff --git a/automation/label.yml b/automation/label.yml deleted file mode 100644 index e90b599b9a..0000000000 --- a/automation/label.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler/blob/master/README.md - -name: Labeler -on: [pull_request] - -jobs: - label: - - runs-on: ubuntu-latest - - steps: - - uses: actions/labeler@v2 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/automation/manual.yml b/automation/manual.yml new file mode 100644 index 0000000000..11b2e3558a --- /dev/null +++ b/automation/manual.yml @@ -0,0 +1,32 @@ +# This is a basic workflow that is manually triggered + +name: Manual workflow + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Person to greet' + # Default value if no value is explicitly provided + default: 'World' + # Input has to be provided for the workflow to run + required: true + # The data type of the input + type: string + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send greeting + run: echo "Hello ${{ inputs.name }}" diff --git a/automation/properties/greetings.properties.json b/automation/properties/greetings.properties.json deleted file mode 100644 index 743afe3863..0000000000 --- a/automation/properties/greetings.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Greetings", - "description": "Greets users who are first time contributors to the repo", - "iconName": "octicon smiley", - "categories": ["Automation", "SDLC"] -} diff --git a/automation/properties/label.properties.json b/automation/properties/label.properties.json deleted file mode 100644 index 87a00c885d..0000000000 --- a/automation/properties/label.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Labeler", - "description": "Labels pull requests based on the files changed", - "iconName": "octicon tag", - "categories": ["Automation", "SDLC"] -} diff --git a/automation/properties/manual.properties.json b/automation/properties/manual.properties.json new file mode 100644 index 0000000000..1befabec0a --- /dev/null +++ b/automation/properties/manual.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Manual workflow", + "description": "Simple workflow that is manually triggered.", + "iconName": "octicon person", + "categories": ["Automation"] +} diff --git a/automation/stale.yml b/automation/stale.yml index 7bbc0505bf..1322eafd69 100644 --- a/automation/stale.yml +++ b/automation/stale.yml @@ -1,16 +1,24 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale name: Mark stale issues and pull requests on: schedule: - - cron: "0 0 * * *" + - cron: $cron-daily jobs: stale: runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write steps: - - uses: actions/stale@v1 + - uses: actions/stale@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'Stale issue message' diff --git a/ci/ada.yml b/ci/ada.yml new file mode 100644 index 0000000000..ecb01cd8ad --- /dev/null +++ b/ci/ada.yml @@ -0,0 +1,24 @@ +name: Ada (GNAT) + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up GNAT toolchain + run: > + sudo apt-get update && + sudo apt-get install gnat gprbuild + + - name: Build + run: gprbuild -j0 -p diff --git a/ci/android.yml b/ci/android.yml index 7ec0147524..fec1eb98b3 100644 --- a/ci/android.yml +++ b/ci/android.yml @@ -2,9 +2,9 @@ name: Android CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -12,10 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build diff --git a/ci/ant.yml b/ci/ant.yml index efebba5a07..8cfe6417a7 100644 --- a/ci/ant.yml +++ b/ci/ant.yml @@ -1,13 +1,13 @@ # This workflow will build a Java project with Ant -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant name: Java CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -15,10 +15,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: '11' + distribution: 'temurin' - name: Build with Ant run: ant -noinput -buildfile build.xml diff --git a/ci/aws.yml b/ci/aws.yml deleted file mode 100644 index 40094ae9be..0000000000 --- a/ci/aws.yml +++ /dev/null @@ -1,80 +0,0 @@ -# This workflow will build and push a new container image to Amazon ECR, -# and then will deploy a new task definition to Amazon ECS, when a release is created -# -# To use this workflow, you will need to complete the following set-up steps: -# -# 1. Create an ECR repository to store your images. -# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`. -# Replace the value of `ECR_REPOSITORY` in the workflow below with your repository's name. -# Replace the value of `aws-region` in the workflow below with your repository's region. -# -# 2. Create an ECS task definition, an ECS cluster, and an ECS service. -# For example, follow the Getting Started guide on the ECS console: -# https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun -# Replace the values for `service` and `cluster` in the workflow below with your service and cluster names. -# -# 3. Store your ECS task definition as a JSON file in your repository. -# The format should follow the output of `aws ecs register-task-definition --generate-cli-skeleton`. -# Replace the value of `task-definition` in the workflow below with your JSON file's name. -# Replace the value of `container-name` in the workflow below with the name of the container -# in the `containerDefinitions` section of the task definition. -# -# 4. Store an IAM user access key in GitHub Actions secrets named `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. -# See the documentation for each action used below for the recommended IAM policies for this IAM user, -# and best practices on handling the access key credentials. - -on: - release: - types: [created] - -name: Deploy to Amazon ECS - -jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-2 - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Build, tag, and push image to Amazon ECR - id: build-image - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: my-ecr-repo - IMAGE_TAG: ${{ github.sha }} - run: | - # Build a docker container and - # push it to ECR so that it can - # be deployed to ECS. - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" - - - name: Fill in the new image ID in the Amazon ECS task definition - id: task-def - uses: aws-actions/amazon-ecs-render-task-definition@v1 - with: - task-definition: task-definition.json - container-name: sample-app - image: ${{ steps.build-image.outputs.image }} - - - name: Deploy Amazon ECS task definition - uses: aws-actions/amazon-ecs-deploy-task-definition@v1 - with: - task-definition: ${{ steps.task-def.outputs.task-definition }} - service: sample-app-service - cluster: default - wait-for-service-stability: true \ No newline at end of file diff --git a/ci/azure.yml b/ci/azure.yml deleted file mode 100644 index a638c4cb3e..0000000000 --- a/ci/azure.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This workflow will build and push a node.js application to an Azure Web App when a release is created. -# -# This workflow assumes you have already created the target Azure App Service web app. -# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan -# -# To configure this workflow: -# -# 1. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile. -# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret -# -# 2. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below). -# -# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions -# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples -on: - release: - types: [created] - -env: - AZURE_WEBAPP_NAME: your-app-name # set this to your application's name - AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root - NODE_VERSION: '10.x' # set this to the node version to use - -jobs: - build-and-deploy: - name: Build and Deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - name: npm install, build, and test - run: | - # Build and test the project, then - # deploy to Azure Web App. - npm install - npm run build --if-present - npm run test --if-present - - name: 'Deploy to Azure WebApp' - uses: azure/webapps-deploy@v2 - with: - app-name: ${{ env.AZURE_WEBAPP_NAME }} - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} diff --git a/ci/blank.yml b/ci/blank.yml index d6783e2188..8decfee630 100644 --- a/ci/blank.yml +++ b/ci/blank.yml @@ -2,13 +2,16 @@ name: CI -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch +# Controls when the workflow will run on: + # Triggers the workflow on push or pull request events but only for the $default-branch branch push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -19,15 +22,15 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. diff --git a/ci/c-cpp.yml b/ci/c-cpp.yml index e3233268f7..087efee6bf 100644 --- a/ci/c-cpp.yml +++ b/ci/c-cpp.yml @@ -2,9 +2,9 @@ name: C/C++ CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: configure run: ./configure - name: make diff --git a/ci/clojure.yml b/ci/clojure.yml index 22bfe20398..06396a8985 100644 --- a/ci/clojure.yml +++ b/ci/clojure.yml @@ -2,9 +2,9 @@ name: Clojure CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies run: lein deps - name: Run tests diff --git a/ci/cmake-multi-platform.yml b/ci/cmake-multi-platform.yml new file mode 100644 index 0000000000..6d493980bd --- /dev/null +++ b/ci/cmake-multi-platform.yml @@ -0,0 +1,75 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake on multiple platforms + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # 3. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest] + build_type: [Release] + c_compiler: [gcc, clang, cl] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + exclude: + - os: windows-latest + c_compiler: gcc + - os: windows-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: cl + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} diff --git a/ci/cmake-single-platform.yml b/ci/cmake-single-platform.yml new file mode 100644 index 0000000000..1e89f2f1fa --- /dev/null +++ b/ci/cmake-single-platform.yml @@ -0,0 +1,39 @@ +# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml +name: CMake on a single platform + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + diff --git a/ci/crystal.yml b/ci/crystal.yml index ce9dbfcd3b..0b4f5704cf 100644 --- a/ci/crystal.yml +++ b/ci/crystal.yml @@ -2,9 +2,9 @@ name: Crystal CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -15,7 +15,7 @@ jobs: image: crystallang/crystal steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies run: shards install - name: Run tests diff --git a/ci/dart.yml b/ci/dart.yml deleted file mode 100644 index 11e18c7beb..0000000000 --- a/ci/dart.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Dart CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - container: - image: google/dart:latest - - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: pub get - - name: Run tests - run: pub run test diff --git a/ci/django.yml b/ci/django.yml index c806047783..0503635290 100644 --- a/ci/django.yml +++ b/ci/django.yml @@ -2,9 +2,9 @@ name: Django CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -13,12 +13,12 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies diff --git a/ci/docker-image.yml b/ci/docker-image.yml index e57d42a7c9..be757cca1e 100644 --- a/ci/docker-image.yml +++ b/ci/docker-image.yml @@ -2,9 +2,9 @@ name: Docker Image CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: @@ -13,6 +13,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build the Docker image run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) diff --git a/ci/docker-publish.yml b/ci/docker-publish.yml deleted file mode 100644 index 9e80e76c88..0000000000 --- a/ci/docker-publish.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Docker - -on: - push: - # Publish `master` as Docker `latest` image. - branches: - - master - - # Publish `v1.2.3` tags as releases. - tags: - - v* - - # Run tests for any PRs. - pull_request: - -env: - # TODO: Change variable to your image's name. - IMAGE_NAME: image - -jobs: - # Run tests. - # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Run tests - run: | - if [ -f docker-compose.test.yml ]; then - docker-compose --file docker-compose.test.yml build - docker-compose --file docker-compose.test.yml run sut - else - docker build . --file Dockerfile - fi - - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - # Ensure test job passes before pushing image. - needs: test - - runs-on: ubuntu-latest - if: github.event_name == 'push' - - steps: - - uses: actions/checkout@v2 - - - name: Build image - run: docker build . --file Dockerfile --tag $IMAGE_NAME - - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Use Docker `latest` tag convention - [ "$VERSION" == "master" ] && VERSION=latest - - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/ci/dotnet-core.yml b/ci/dotnet-core.yml deleted file mode 100644 index f734ea7b55..0000000000 --- a/ci/dotnet-core.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: .NET Core - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-restore --verbosity normal diff --git a/ci/dotnet.yml b/ci/dotnet.yml new file mode 100644 index 0000000000..b869d6ef84 --- /dev/null +++ b/ci/dotnet.yml @@ -0,0 +1,28 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/ci/elixir.yml b/ci/elixir.yml deleted file mode 100644 index 4de7dcbd84..0000000000 --- a/ci/elixir.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Elixir CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup elixir - uses: actions/setup-elixir@v1 - with: - elixir-version: 1.9.4 # Define the elixir version [required] - otp-version: 22.2 # Define the OTP version [required] - - name: Install Dependencies - run: mix deps.get - - name: Run Tests - run: mix test diff --git a/ci/erlang.yml b/ci/erlang.yml index fd28497ff7..d8dcb76cc0 100644 --- a/ci/erlang.yml +++ b/ci/erlang.yml @@ -2,9 +2,12 @@ name: Erlang CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] + +permissions: + contents: read jobs: @@ -16,7 +19,7 @@ jobs: image: erlang:22.0.7 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Compile run: rebar3 compile - name: Run tests diff --git a/ci/gem-push.yml b/ci/gem-push.yml deleted file mode 100644 index 08733c7e7a..0000000000 --- a/ci/gem-push.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Ruby Gem - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - name: Build + Publish - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 2.6 - uses: actions/setup-ruby@v1 - with: - version: 2.6.x - - - name: Publish to GPR - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem - env: - GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}} - OWNER: username - - - name: Publish to RubyGems - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push *.gem - env: - GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}} diff --git a/ci/generator-generic-ossf-slsa3-publish.yml b/ci/generator-generic-ossf-slsa3-publish.yml new file mode 100644 index 0000000000..35c829b139 --- /dev/null +++ b/ci/generator-generic-ossf-slsa3-publish.yml @@ -0,0 +1,66 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow lets you generate SLSA provenance file for your project. +# The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements +# The project is an initiative of the OpenSSF (openssf.org) and is developed at +# https://github.com/slsa-framework/slsa-github-generator. +# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. +# For more information about SLSA and how it improves the supply-chain, visit slsa.dev. + +name: SLSA generic generator +on: + workflow_dispatch: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + outputs: + digests: ${{ steps.hash.outputs.digests }} + + steps: + - uses: actions/checkout@v4 + + # ======================================================== + # + # Step 1: Build your artifacts. + # + # ======================================================== + - name: Build artifacts + run: | + # These are some amazing artifacts. + echo "artifact1" > artifact1 + echo "artifact2" > artifact2 + + # ======================================================== + # + # Step 2: Add a step to generate the provenance subjects + # as shown below. Update the sha256 sum arguments + # to include all binaries that you generate + # provenance for. + # + # ======================================================== + - name: Generate subject for provenance + id: hash + run: | + set -euo pipefail + + # List the artifacts the provenance will refer to. + files=$(ls artifact*) + # Generate the subjects (base64 encoded). + echo "hashes=$(sha256sum $files | base64 -w0)" >> "${GITHUB_OUTPUT}" + + provenance: + needs: [build] + permissions: + actions: read # To read the workflow path. + id-token: write # To sign the provenance. + contents: write # To add assets to a release. + uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0 + with: + base64-subjects: "${{ needs.build.outputs.digests }}" + upload-assets: true # Optional: Upload to a new release diff --git a/ci/go-ossf-slsa3-publish.yml b/ci/go-ossf-slsa3-publish.yml new file mode 100644 index 0000000000..79ea193f75 --- /dev/null +++ b/ci/go-ossf-slsa3-publish.yml @@ -0,0 +1,38 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow lets you compile your Go project using a SLSA3 compliant builder. +# This workflow will generate a so-called "provenance" file describing the steps +# that were performed to generate the final binary. +# The project is an initiative of the OpenSSF (openssf.org) and is developed at +# https://github.com/slsa-framework/slsa-github-generator. +# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. +# For more information about SLSA and how it improves the supply-chain, visit slsa.dev. + +name: SLSA Go releaser +on: + workflow_dispatch: + release: + types: [created] + +permissions: read-all + +jobs: + # ======================================================================================================================================== + # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project. + # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file + #========================================================================================================================================= + build: + permissions: + id-token: write # To sign. + contents: write # To upload release assets. + actions: read # To read workflow path. + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0 + with: + go-version: 1.17 + # ============================================================================================================= + # Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects + # ============================================================================================================= + diff --git a/ci/go.yml b/ci/go.yml index d31e87f957..2154740733 100644 --- a/ci/go.yml +++ b/ci/go.yml @@ -1,37 +1,28 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + name: Go on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: - name: Build runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - - name: Set up Go 1.x - uses: actions/setup-go@v2 + - name: Set up Go + uses: actions/setup-go@v4 with: - go-version: ^1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi + go-version: '1.20' - name: Build - run: go build -v . + run: go build -v ./... - name: Test - run: go test -v . + run: go test -v ./... diff --git a/ci/google.yml b/ci/google.yml deleted file mode 100644 index b8d1079527..0000000000 --- a/ci/google.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow will build a docker container, publish it to Google Container Registry, and deploy it to GKE when a release is created -# -# To configure this workflow: -# -# 1. Ensure that your repository contains the necessary configuration for your Google Kubernetes Engine cluster, including deployment.yml, kustomization.yml, service.yml, etc. -# -# 2. Set up secrets in your workspace: GKE_PROJECT with the name of the project, GKE_EMAIL with the service account email, GKE_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs). -# -# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, REGISTRY_HOSTNAME and DEPLOYMENT_NAME environment variables (below). - -name: Build and Deploy to GKE - -on: - release: - types: [created] - -# Environment variables available to all jobs and steps in this workflow -env: - GKE_PROJECT: ${{ secrets.GKE_PROJECT }} - GKE_EMAIL: ${{ secrets.GKE_EMAIL }} - GITHUB_SHA: ${{ github.sha }} - GKE_ZONE: us-west1-a - GKE_CLUSTER: example-gke-cluster - IMAGE: gke-test - REGISTRY_HOSTNAME: gcr.io - DEPLOYMENT_NAME: gke-test - -jobs: - setup-build-publish-deploy: - name: Setup, Build, Publish, and Deploy - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - # Setup gcloud CLI - - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master - with: - version: '270.0.0' - service_account_email: ${{ secrets.GKE_EMAIL }} - service_account_key: ${{ secrets.GKE_KEY }} - - # Configure docker to use the gcloud command-line tool as a credential helper - - run: | - # Set up docker to authenticate - # via gcloud command-line tool. - gcloud auth configure-docker - - # Build the Docker image - - name: Build - run: | - docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" \ - --build-arg GITHUB_SHA="$GITHUB_SHA" \ - --build-arg GITHUB_REF="$GITHUB_REF" . - - # Push the Docker image to Google Container Registry - - name: Publish - run: | - docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:$GITHUB_SHA - - # Set up kustomize - - name: Set up Kustomize - run: | - curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 - chmod u+x ./kustomize - - # Deploy the Docker image to the GKE cluster - - name: Deploy - run: | - gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT - ./kustomize edit set image $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:${GITHUB_SHA} - ./kustomize build . | kubectl apply -f - - kubectl rollout status deployment/$DEPLOYMENT_NAME - kubectl get services -o wide diff --git a/ci/gradle-publish.yml b/ci/gradle-publish.yml deleted file mode 100644 index cec487ecc5..0000000000 --- a/ci/gradle-publish.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java#publishing-using-gradle - -name: Gradle Package - -on: - release: - types: [created] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Gradle - run: gradle build - - # The USERNAME and TOKEN need to correspond to the credentials environment variables used in - # the publishing section of your build.gradle - - name: Publish to GitHub Packages - run: gradle publish - env: - USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/ci/gradle.yml b/ci/gradle.yml deleted file mode 100644 index 58e1c59ce1..0000000000 --- a/ci/gradle.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Java CI with Gradle - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build diff --git a/ci/haskell.yml b/ci/haskell.yml deleted file mode 100644 index 4bc2d165a1..0000000000 --- a/ci/haskell.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Haskell CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-haskell@v1 - with: - ghc-version: '8.8.2' - cabal-version: '3.0' - - - name: Cache - uses: actions/cache@v1 - env: - cache-name: cache-cabal - with: - path: ~/.cabal - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Install dependencies - run: | - cabal update - cabal build --only-dependencies --enable-tests --enable-benchmarks - - name: Build - run: cabal build --enable-tests --enable-benchmarks all - - name: Run tests - run: cabal test all diff --git a/ci/ibm.yml b/ci/ibm.yml deleted file mode 100644 index 8af050f364..0000000000 --- a/ci/ibm.yml +++ /dev/null @@ -1,74 +0,0 @@ -# This workflow will build a docker container, publish it to IBM Container Registry, and deploy it to IKS when a release is created -# -# To configure this workflow: -# -# 1. Ensure that your repository contains a Dockerfile -# 2. Setup secrets in your repository by going to settings: Create ICR_NAMESPACE and IBM_CLOUD_API_KEY -# 3. Change the values for the IBM_CLOUD_REGION, REGISTRY_HOSTNAME, IMAGE_NAME, IKS_CLUSTER, DEPLOYMENT_NAME, and PORT - -name: Build and Deploy to IKS - -on: - release: - types: [created] - -# Environment variables available to all jobs and steps in this workflow -env: - GITHUB_SHA: ${{ github.sha }} - IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }} - IBM_CLOUD_REGION: us-south - ICR_NAMESPACE: ${{ secrets.ICR_NAMESPACE }} - REGISTRY_HOSTNAME: us.icr.io - IMAGE_NAME: iks-test - IKS_CLUSTER: example-iks-cluster-name-or-id - DEPLOYMENT_NAME: iks-test - PORT: 5001 - -jobs: - setup-build-publish-deploy: - name: Setup, Build, Publish, and Deploy - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - # Download and Install IBM Cloud CLI - - name: Install IBM Cloud CLI - run: | - curl -fsSL https://clis.cloud.ibm.com/install/linux | sh - ibmcloud --version - ibmcloud config --check-version=false - ibmcloud plugin install -f kubernetes-service - ibmcloud plugin install -f container-registry - - # Authenticate with IBM Cloud CLI - - name: Authenticate with IBM Cloud CLI - run: | - ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g default - ibmcloud cr region-set "${IBM_CLOUD_REGION}" - ibmcloud cr login - - # Build the Docker image - - name: Build with Docker - run: | - docker build -t "$REGISTRY_HOSTNAME"/"$ICR_NAMESPACE"/"$IMAGE_NAME":"$GITHUB_SHA" \ - --build-arg GITHUB_SHA="$GITHUB_SHA" \ - --build-arg GITHUB_REF="$GITHUB_REF" . - - # Push the image to IBM Container Registry - - name: Push the image to ICR - run: | - docker push $REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA - - # Deploy the Docker image to the IKS cluster - - name: Deploy to IKS - run: | - ibmcloud ks cluster config --cluster $IKS_CLUSTER - kubectl config current-context - kubectl create deployment $DEPLOYMENT_NAME --image=$REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA --dry-run -o yaml > deployment.yaml - kubectl apply -f deployment.yaml - kubectl rollout status deployment/$DEPLOYMENT_NAME - kubectl create service loadbalancer $DEPLOYMENT_NAME --tcp=80:$PORT --dry-run -o yaml > service.yaml - kubectl apply -f service.yaml - kubectl get services -o wide diff --git a/ci/ios.yml b/ci/ios.yml new file mode 100644 index 0000000000..e1dca4bdef --- /dev/null +++ b/ci/ios.yml @@ -0,0 +1,44 @@ +name: iOS starter workflow + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + name: Build and Test default scheme using any available iPhone simulator + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + - name: Build + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" + - name: Test + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" diff --git a/ci/jekyll.yml b/ci/jekyll-docker.yml similarity index 60% rename from ci/jekyll.yml rename to ci/jekyll-docker.yml index 64df081ef4..4ae36d7826 100644 --- a/ci/jekyll.yml +++ b/ci/jekyll-docker.yml @@ -2,9 +2,9 @@ name: Jekyll site CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build the site in the jekyll/builder container run: | docker run \ -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future" + jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" diff --git a/ci/laravel.yml b/ci/laravel.yml deleted file mode 100644 index 7fc4665d5f..0000000000 --- a/ci/laravel.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Laravel - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - laravel-tests: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Copy .env - run: php -r "file_exists('.env') || copy('.env.example', '.env');" - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - - name: Generate key - run: php artisan key:generate - - name: Directory Permissions - run: chmod -R 777 storage bootstrap/cache - - name: Create Database - run: | - mkdir -p database - touch database/database.sqlite - - name: Execute tests (Unit and Feature tests) via PHPUnit - env: - DB_CONNECTION: sqlite - DB_DATABASE: database/database.sqlite - run: vendor/bin/phpunit diff --git a/ci/makefile.yml b/ci/makefile.yml new file mode 100644 index 0000000000..5b6d2e6316 --- /dev/null +++ b/ci/makefile.yml @@ -0,0 +1,27 @@ +name: Makefile CI + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: configure + run: ./configure + + - name: Install dependencies + run: make + + - name: Run check + run: make check + + - name: Run distcheck + run: make distcheck diff --git a/ci/maven-publish.yml b/ci/maven-publish.yml index fb1c7eec77..64b848b61d 100644 --- a/ci/maven-publish.yml +++ b/ci/maven-publish.yml @@ -1,5 +1,5 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path name: Maven Package @@ -11,13 +11,17 @@ jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: '11' + distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file @@ -27,4 +31,4 @@ jobs: - name: Publish to GitHub Packages Apache Maven run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml env: - GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file + GITHUB_TOKEN: ${{ github.token }} diff --git a/ci/maven.yml b/ci/maven.yml deleted file mode 100644 index c8aeb3a277..0000000000 --- a/ci/maven.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Maven - run: mvn -B package --file pom.xml diff --git a/ci/node.js.yml b/ci/node.js.yml index e772a1cd78..d5ccc1494a 100644 --- a/ci/node.js.yml +++ b/ci/node.js.yml @@ -1,13 +1,13 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs name: Node.js CI on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -16,14 +16,16 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x] + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + cache: 'npm' - run: npm ci - run: npm run build --if-present - run: npm test diff --git a/ci/npm-publish-github-packages.yml b/ci/npm-publish-github-packages.yml new file mode 100644 index 0000000000..99531c0178 --- /dev/null +++ b/ci/npm-publish-github-packages.yml @@ -0,0 +1,36 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: $registry-url(npm) + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/ci/npm-publish.yml b/ci/npm-publish.yml index 861e37239f..2a4766d389 100644 --- a/ci/npm-publish.yml +++ b/ci/npm-publish.yml @@ -1,5 +1,5 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages name: Node.js Package @@ -11,10 +11,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 12 + node-version: 20 - run: npm ci - run: npm test @@ -22,26 +22,12 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 12 + node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} - - publish-gpr: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://npm.pkg.github.com/ - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/ci/objective-c-xcode.yml b/ci/objective-c-xcode.yml new file mode 100644 index 0000000000..8c73fcee1a --- /dev/null +++ b/ci/objective-c-xcode.yml @@ -0,0 +1,30 @@ +name: Xcode - Build and Analyze + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + name: Build and analyse default scheme using xcodebuild command + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + - name: Build + env: + scheme: ${{ 'default' }} + run: | + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild clean build analyze -scheme "$scheme" -"$filetype_parameter" "$file_to_build" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/ci/php.yml b/ci/php.yml index 989deb2164..0cf8c96a2e 100644 --- a/ci/php.yml +++ b/ci/php.yml @@ -2,9 +2,12 @@ name: PHP Composer on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] + +permissions: + contents: read jobs: build: @@ -12,10 +15,19 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Validate composer.json and composer.lock - run: composer validate + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- - name: Install dependencies run: composer install --prefer-dist --no-progress diff --git a/ci/properties/ada.properties.json b/ci/properties/ada.properties.json new file mode 100644 index 0000000000..c4c2b3a3a0 --- /dev/null +++ b/ci/properties/ada.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Ada", + "description": "Build Ada project with GPRbuild.", + "iconName": "ada", + "categories": ["Continuous integration", "Ada"] +} diff --git a/ci/properties/android.properties.json b/ci/properties/android.properties.json index 29d293f1a5..a3ff2cdcea 100644 --- a/ci/properties/android.properties.json +++ b/ci/properties/android.properties.json @@ -2,5 +2,5 @@ "name": "Android CI", "description": "Build an Android project with Gradle.", "iconName": "android", - "categories": ["Java", "Mobile"] + "categories": ["Continuous integration", "Java", "Mobile"] } diff --git a/ci/properties/ant.properties.json b/ci/properties/ant.properties.json index 5a4d7a99e8..93d54738cf 100644 --- a/ci/properties/ant.properties.json +++ b/ci/properties/ant.properties.json @@ -2,5 +2,5 @@ "name": "Java with Ant", "description": "Build and test a Java project with Apache Ant.", "iconName": "ant", - "categories": ["Ant", "Java"] + "categories": ["Continuous integration", "Ant", "Java"] } diff --git a/ci/properties/aws.properties.json b/ci/properties/aws.properties.json deleted file mode 100644 index 2988e7c0c7..0000000000 --- a/ci/properties/aws.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Deploy to Amazon ECS", - "description": "Deploy a container to an Amazon ECS service powered by AWS Fargate or Amazon EC2.", - "iconName": "aws", - "categories": null -} \ No newline at end of file diff --git a/ci/properties/azure.properties.json b/ci/properties/azure.properties.json deleted file mode 100644 index ba92f6fa5c..0000000000 --- a/ci/properties/azure.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Deploy Node.js to Azure Web App", - "description": "Build a Node.js project and deploy it to an Azure Web App.", - "iconName": "azure", - "categories": null -} \ No newline at end of file diff --git a/ci/properties/blank.properties.json b/ci/properties/blank.properties.json index d244772cfd..610327f083 100644 --- a/ci/properties/blank.properties.json +++ b/ci/properties/blank.properties.json @@ -1,6 +1,7 @@ { "name": "Simple workflow", "description": "Start with a file with the minimum necessary structure.", + "creator": "GitHub", "iconName": "blank", "categories": null } diff --git a/ci/properties/c-cpp.properties.json b/ci/properties/c-cpp.properties.json index 5d2a2df038..2d214a4087 100644 --- a/ci/properties/c-cpp.properties.json +++ b/ci/properties/c-cpp.properties.json @@ -2,5 +2,5 @@ "name": "C/C++ with Make", "description": "Build and test a C/C++ project using Make.", "iconName": "c-cpp", - "categories": ["C", "C++"] + "categories": ["Continuous integration", "C", "C++"] } diff --git a/ci/properties/clojure.properties.json b/ci/properties/clojure.properties.json index 5a9e3ed163..f57dfdf3d2 100644 --- a/ci/properties/clojure.properties.json +++ b/ci/properties/clojure.properties.json @@ -2,5 +2,5 @@ "name": "Clojure", "description": "Build and test a Clojure project with Leiningen.", "iconName": "clojure", - "categories": ["Clojure", "Java"] + "categories": ["Continuous integration", "Clojure", "Java"] } diff --git a/ci/properties/cmake-multi-platform.properties.json b/ci/properties/cmake-multi-platform.properties.json new file mode 100644 index 0000000000..59d1b47336 --- /dev/null +++ b/ci/properties/cmake-multi-platform.properties.json @@ -0,0 +1,6 @@ +{ + "name": "CMake based, multi-platform projects", + "description": "Build and test a CMake based project on multiple platforms.", + "iconName": "cmake", + "categories": ["Continuous integration", "C", "C++"] +} diff --git a/ci/properties/cmake-single-platform.properties.json b/ci/properties/cmake-single-platform.properties.json new file mode 100644 index 0000000000..c0aa074537 --- /dev/null +++ b/ci/properties/cmake-single-platform.properties.json @@ -0,0 +1,6 @@ +{ + "name": "CMake based, single-platform projects", + "description": "Build and test a CMake based project on a single-platform.", + "iconName": "cmake", + "categories": ["Continuous integration", "C", "C++"] +} diff --git a/ci/properties/crystal.properties.json b/ci/properties/crystal.properties.json index bb058f760e..244adbf021 100644 --- a/ci/properties/crystal.properties.json +++ b/ci/properties/crystal.properties.json @@ -2,5 +2,5 @@ "name": "Crystal", "description": "Build and test a Crystal project.", "iconName": "crystal", - "categories": ["Crystal"] + "categories": ["Continuous integration", "Crystal"] } diff --git a/ci/properties/dart.properties.json b/ci/properties/dart.properties.json deleted file mode 100644 index 022a003227..0000000000 --- a/ci/properties/dart.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Dart", - "description": "Build and test a Dart project with Pub.", - "iconName": "dart", - "categories": ["Dart"] -} diff --git a/ci/properties/django.properties.json b/ci/properties/django.properties.json index 30154416e2..791fb21aa6 100644 --- a/ci/properties/django.properties.json +++ b/ci/properties/django.properties.json @@ -2,5 +2,5 @@ "name": "Django", "description": "Build and Test a Django Project", "iconName": "django", - "categories": ["Python", "Django"] + "categories": ["Continuous integration", "Python", "Django"] } diff --git a/ci/properties/docker-image.properties.json b/ci/properties/docker-image.properties.json index 8ad7552468..b13144ccb7 100644 --- a/ci/properties/docker-image.properties.json +++ b/ci/properties/docker-image.properties.json @@ -2,5 +2,5 @@ "name": "Docker image", "description": "Build a Docker image to deploy, run, or push to a registry.", "iconName": "docker", - "categories": ["Dockerfile"] + "categories": ["Continuous integration", "Dockerfile"] } diff --git a/ci/properties/docker-publish.properties.json b/ci/properties/docker-publish.properties.json deleted file mode 100644 index 1b36c0f0e9..0000000000 --- a/ci/properties/docker-publish.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Publish Docker Container", - "description": "Build, test and push Docker image to GitHub Packages.", - "iconName": "docker", - "categories": ["Dockerfile"] -} diff --git a/ci/properties/dotnet-core.properties.json b/ci/properties/dotnet-core.properties.json deleted file mode 100644 index 3386a3d7ee..0000000000 --- a/ci/properties/dotnet-core.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": ".NET Core", - "description": "Build and test a .NET Core or ASP.NET Core project.", - "iconName": "dotnetcore", - "categories": ["C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET"] -} diff --git a/ci/properties/dotnet.properties.json b/ci/properties/dotnet.properties.json new file mode 100644 index 0000000000..1a466042c3 --- /dev/null +++ b/ci/properties/dotnet.properties.json @@ -0,0 +1,6 @@ +{ + "name": ".NET", + "description": "Build and test a .NET or ASP.NET Core project.", + "iconName": "dotnet", + "categories": ["Continuous integration", "C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET", "AspNetCore", "DotNetConsole"] +} diff --git a/ci/properties/elixir.properties.json b/ci/properties/elixir.properties.json deleted file mode 100644 index 572992df13..0000000000 --- a/ci/properties/elixir.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Elixir", - "description": "Build and test an Elixir project with Mix.", - "iconName": "elixir", - "categories": ["Elixir", "Erlang"] -} diff --git a/ci/properties/erlang.properties.json b/ci/properties/erlang.properties.json index d712b0564c..eba9af698f 100644 --- a/ci/properties/erlang.properties.json +++ b/ci/properties/erlang.properties.json @@ -2,5 +2,5 @@ "name": "Erlang", "description": "Build and test an Erlang project with rebar.", "iconName": "erlang", - "categories": ["Erlang"] + "categories": ["Continuous integration", "Erlang"] } diff --git a/ci/properties/gem-push.properties.json b/ci/properties/gem-push.properties.json deleted file mode 100644 index c54e7b57d6..0000000000 --- a/ci/properties/gem-push.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Ruby Gem", - "description": "Pushes a Ruby Gem to RubyGems and GitHub Package Registry.", - "iconName": "ruby-gems", - "categories": ["Ruby", "SDLC"] -} diff --git a/ci/properties/generator-generic-ossf-slsa3-publish.properties.json b/ci/properties/generator-generic-ossf-slsa3-publish.properties.json new file mode 100644 index 0000000000..32cf63d06b --- /dev/null +++ b/ci/properties/generator-generic-ossf-slsa3-publish.properties.json @@ -0,0 +1,7 @@ +{ + "name": "SLSA Generic generator", + "creator": "Open Source Security Foundation (OpenSSF)", + "description": "Generate SLSA3 provenance for your existing release workflows", + "iconName": "generator-generic-ossf-slsa3-publish", + "categories": ["Continuous integration", "Go", "Elixir", "Erlang", "PHP", "Haskell", "Rust", "Java", "Scala", "Gradle", "Maven", "Python", "C", "C++", "TypeScript", "JavaScript", "npm", "Ruby", "HTML", "Composer", "Makefile", "Ada"] +} diff --git a/ci/properties/go-ossf-slsa3-publish.properties.json b/ci/properties/go-ossf-slsa3-publish.properties.json new file mode 100644 index 0000000000..2d58eaffd4 --- /dev/null +++ b/ci/properties/go-ossf-slsa3-publish.properties.json @@ -0,0 +1,7 @@ +{ + "name": "SLSA Go releaser", + "creator": "Open Source Security Foundation (OpenSSF)", + "description": "Compile your Go project using a SLSA3 compliant builder", + "iconName": "go-ossf-slsa3-publish", + "categories": ["Continuous integration", "Go"] +} diff --git a/ci/properties/go.properties.json b/ci/properties/go.properties.json index b96c0a1159..1187f94bb4 100644 --- a/ci/properties/go.properties.json +++ b/ci/properties/go.properties.json @@ -2,5 +2,5 @@ "name": "Go", "description": "Build a Go project.", "iconName": "go", - "categories": ["Go"] + "categories": ["Continuous integration", "Go"] } diff --git a/ci/properties/google.properties.json b/ci/properties/google.properties.json deleted file mode 100644 index dee44b9be2..0000000000 --- a/ci/properties/google.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Build and Deploy to GKE", - "description": "Build a docker container, publish it to Google Container Registry, and deploy to GKE.", - "iconName": "googlegke", - "categories": null -} \ No newline at end of file diff --git a/ci/properties/gradle-publish.properties.json b/ci/properties/gradle-publish.properties.json deleted file mode 100644 index 90b7295585..0000000000 --- a/ci/properties/gradle-publish.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Publish Java Package with Gradle", - "description": "Build a Java Package using Gradle and publish to GitHub Packages.", - "iconName": "gradle", - "categories": ["Java", "Gradle"] -} \ No newline at end of file diff --git a/ci/properties/gradle.properties.json b/ci/properties/gradle.properties.json deleted file mode 100644 index bfe1a6f045..0000000000 --- a/ci/properties/gradle.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Java with Gradle", - "description": "Build and test a Java project using a Gradle wrapper script.", - "iconName": "gradle", - "categories": ["Java", "Gradle"] -} diff --git a/ci/properties/haskell.properties.json b/ci/properties/haskell.properties.json deleted file mode 100644 index 2dedbf2e86..0000000000 --- a/ci/properties/haskell.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Haskell", - "description": "Build and test a Haskell project with Cabal.", - "iconName": "haskell", - "categories": ["Haskell"] -} diff --git a/ci/properties/ibm.properties.json b/ci/properties/ibm.properties.json deleted file mode 100644 index 44d899624a..0000000000 --- a/ci/properties/ibm.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Build and Deploy to IKS", - "description": "Build a docker container, publish it to IBM Container Registry, and deploy to IKS.", - "iconName": "ibm", - "categories": null -} \ No newline at end of file diff --git a/ci/properties/ios.properties.json b/ci/properties/ios.properties.json new file mode 100644 index 0000000000..f88edc969d --- /dev/null +++ b/ci/properties/ios.properties.json @@ -0,0 +1,10 @@ +{ + "name": "iOS", + "description": "Build and test an iOS application using xcodebuild and any available iPhone simulator.", + "iconName": "xcode", + "categories": [ + "Continuous integration", + "iOS", + "Xcode" + ] +} diff --git a/ci/properties/jekyll.properties.json b/ci/properties/jekyll-docker.properties.json similarity index 54% rename from ci/properties/jekyll.properties.json rename to ci/properties/jekyll-docker.properties.json index 38cc6cd23d..7c66dba0ac 100644 --- a/ci/properties/jekyll.properties.json +++ b/ci/properties/jekyll-docker.properties.json @@ -1,6 +1,6 @@ { - "name": "Jekyll", + "name": "Jekyll using Docker image", "description": "Package a Jekyll site using the jekyll/builder Docker image.", "iconName": "jekyll", - "categories": ["HTML"] + "categories": ["Continuous integration", "HTML"] } diff --git a/ci/properties/laravel.properties.json b/ci/properties/laravel.properties.json deleted file mode 100644 index f10a4623af..0000000000 --- a/ci/properties/laravel.properties.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Laravel", - "description": "Test a Laravel project.", - "iconName": "php", - "categories": [ - "PHP", - "Laravel" - ] -} \ No newline at end of file diff --git a/ci/properties/makefile.properties.json b/ci/properties/makefile.properties.json new file mode 100644 index 0000000000..209bf7025d --- /dev/null +++ b/ci/properties/makefile.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Build projects with Make", + "description": "Build and test a project using Make.", + "iconName": "makefile", + "categories": ["Continuous integration", "Makefile"] +} diff --git a/ci/properties/maven-publish.properties.json b/ci/properties/maven-publish.properties.json index 2f59f41478..2bc750fa4d 100644 --- a/ci/properties/maven-publish.properties.json +++ b/ci/properties/maven-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Java Package with Maven", "description": "Build a Java Package using Maven and publish to GitHub Packages.", "iconName": "maven", - "categories": ["Java", "Maven"] + "categories": ["Continuous integration", "Java", "Maven", "Spring", "JSF"] } \ No newline at end of file diff --git a/ci/properties/maven.properties.json b/ci/properties/maven.properties.json deleted file mode 100644 index e322d04152..0000000000 --- a/ci/properties/maven.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Java with Maven", - "description": "Build and test a Java project with Apache Maven.", - "iconName": "maven", - "categories": ["Java", "Maven"] -} diff --git a/ci/properties/node.js.properties.json b/ci/properties/node.js.properties.json index 6ab4c53072..7f68d8842d 100644 --- a/ci/properties/node.js.properties.json +++ b/ci/properties/node.js.properties.json @@ -2,5 +2,5 @@ "name": "Node.js", "description": "Build and test a Node.js project with npm.", "iconName": "nodejs", - "categories": ["JavaScript", "Node", "Npm"] + "categories": ["Continuous integration", "JavaScript", "npm", "React", "Angular", "Vue"] } diff --git a/ci/properties/npm-publish-github-packages.properties.json b/ci/properties/npm-publish-github-packages.properties.json new file mode 100644 index 0000000000..180b73aaeb --- /dev/null +++ b/ci/properties/npm-publish-github-packages.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Publish Node.js Package to GitHub Packages", + "description": "Publishes a Node.js package to GitHub Packages.", + "iconName": "node-package-transparent", + "categories": ["Continuous integration", "JavaScript", "npm"] +} diff --git a/ci/properties/npm-publish.properties.json b/ci/properties/npm-publish.properties.json index d253373b18..cc2c707177 100644 --- a/ci/properties/npm-publish.properties.json +++ b/ci/properties/npm-publish.properties.json @@ -1,6 +1,6 @@ { "name": "Publish Node.js Package", - "description": "Publishes a Node.js package to npm and GitHub Packages.", + "description": "Publishes a Node.js package to npm.", "iconName": "node-package-transparent", - "categories": ["JavaScript", "SDLC"] + "categories": ["Continuous integration", "JavaScript", "npm"] } diff --git a/ci/properties/objective-c-xcode.properties.json b/ci/properties/objective-c-xcode.properties.json new file mode 100644 index 0000000000..e6068feb00 --- /dev/null +++ b/ci/properties/objective-c-xcode.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Xcode - Build and Analyze", + "description": "Build Xcode project using xcodebuild", + "iconName": "xcode", + "categories": ["Continuous integration", "Xcode", "Objective-C"] +} diff --git a/ci/properties/php.properties.json b/ci/properties/php.properties.json index 641e536f28..f345a28f56 100644 --- a/ci/properties/php.properties.json +++ b/ci/properties/php.properties.json @@ -2,5 +2,5 @@ "name": "PHP", "description": "Build and test a PHP application using Composer", "iconName": "php", - "categories": ["PHP", "Composer"] + "categories": ["Continuous integration", "PHP", "Composer"] } \ No newline at end of file diff --git a/ci/properties/pylint.properties.json b/ci/properties/pylint.properties.json new file mode 100644 index 0000000000..23c15dc02a --- /dev/null +++ b/ci/properties/pylint.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Pylint", + "description": "Lint a Python application with pylint.", + "iconName": "python", + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] +} diff --git a/ci/properties/python-app.properties.json b/ci/properties/python-app.properties.json index 34e4a5780a..1229b2961f 100644 --- a/ci/properties/python-app.properties.json +++ b/ci/properties/python-app.properties.json @@ -2,5 +2,5 @@ "name": "Python application", "description": "Create and test a Python application.", "iconName": "python", - "categories": ["Python"] + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-package-conda.properties.json b/ci/properties/python-package-conda.properties.json new file mode 100644 index 0000000000..56007668b8 --- /dev/null +++ b/ci/properties/python-package-conda.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Python Package using Anaconda", + "description": "Create and test a Python package on multiple Python versions using Anaconda for package management.", + "iconName": "python", + "categories": ["Continuous integration", "Python"] +} diff --git a/ci/properties/python-package.properties.json b/ci/properties/python-package.properties.json index 4e09d40d5f..8c9dbcfa62 100644 --- a/ci/properties/python-package.properties.json +++ b/ci/properties/python-package.properties.json @@ -2,5 +2,5 @@ "name": "Python package", "description": "Create and test a Python package on multiple Python versions.", "iconName": "python", - "categories": ["Python"] + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-publish.properties.json b/ci/properties/python-publish.properties.json deleted file mode 100644 index 4fd9eceb68..0000000000 --- a/ci/properties/python-publish.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Publish Python Package", - "description": "Publish a Python Package to PyPI on release.", - "iconName": "python", - "categories": ["Python"] -} diff --git a/ci/properties/ruby.properties.json b/ci/properties/ruby.properties.json deleted file mode 100644 index 904f12fd4a..0000000000 --- a/ci/properties/ruby.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Ruby", - "description": "Build and test a Ruby project with Rake.", - "iconName": "ruby", - "categories": ["Ruby"] -} diff --git a/ci/properties/rust.properties.json b/ci/properties/rust.properties.json index 3a6dc02ae1..3e834d9589 100644 --- a/ci/properties/rust.properties.json +++ b/ci/properties/rust.properties.json @@ -2,5 +2,5 @@ "name": "Rust", "description": "Build and test a Rust project with Cargo.", "iconName": "rust", - "categories": ["Rust"] + "categories": ["Continuous integration", "Rust"] } \ No newline at end of file diff --git a/ci/properties/scala.properties.json b/ci/properties/scala.properties.json deleted file mode 100644 index a92fc7309a..0000000000 --- a/ci/properties/scala.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Scala", - "description": "Build and test a Scala project with SBT.", - "iconName": "scala", - "categories": ["Scala", "Java"] -} diff --git a/ci/properties/swift.properties.json b/ci/properties/swift.properties.json index 9efd64515d..b26a264423 100644 --- a/ci/properties/swift.properties.json +++ b/ci/properties/swift.properties.json @@ -2,5 +2,5 @@ "name": "Swift", "description": "Build and test a Swift Package.", "iconName": "swift", - "categories": ["Swift"] + "categories": ["Continuous integration", "Swift"] } diff --git a/ci/properties/tencent.properties.json b/ci/properties/tencent.properties.json deleted file mode 100644 index b3d9d3f456..0000000000 --- a/ci/properties/tencent.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Tencent Kubernetes Engine", - "description": "This workflow will build a docker container, publish and deploy it to Tencent Kubernetes Engine (TKE).", - "iconName": "tencentcloud", - "categories": null -} diff --git a/ci/properties/terraform.properties.json b/ci/properties/terraform.properties.json deleted file mode 100644 index 34fa16e713..0000000000 --- a/ci/properties/terraform.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Terraform", - "description": "Set up Terraform CLI in your GitHub Actions workflow.", - "iconName": "terraform", - "categories": null -} diff --git a/ci/properties/webpack.properties.json b/ci/properties/webpack.properties.json new file mode 100644 index 0000000000..6d8b1a548a --- /dev/null +++ b/ci/properties/webpack.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Webpack", + "description": "Build a NodeJS project with npm and webpack.", + "iconName": "webpack", + "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Webpack"] +} diff --git a/ci/properties/wpf-dotnet-core.properties.json b/ci/properties/wpf-dotnet-core.properties.json deleted file mode 100644 index f43ea35052..0000000000 --- a/ci/properties/wpf-dotnet-core.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "WPF .NET Core", - "description": "Build, test and publish a Wpf application built on .NET Core.", - "iconName": "dotnetcore", - "categories": ["C#", "Visual Basic", "WPF", ".NET"] -} \ No newline at end of file diff --git a/ci/pylint.yml b/ci/pylint.yml new file mode 100644 index 0000000000..c73e032c0f --- /dev/null +++ b/ci/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/ci/python-app.yml b/ci/python-app.yml index c7f5067453..5963096c33 100644 --- a/ci/python-app.yml +++ b/ci/python-app.yml @@ -1,13 +1,16 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: Python application on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] + +permissions: + contents: read jobs: build: @@ -15,11 +18,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/ci/python-package-conda.yml b/ci/python-package-conda.yml new file mode 100644 index 0000000000..f3586044ab --- /dev/null +++ b/ci/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest diff --git a/ci/python-package.yml b/ci/python-package.yml index f1abc2ffce..19247ca7b7 100644 --- a/ci/python-package.yml +++ b/ci/python-package.yml @@ -1,32 +1,33 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: Python package on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: ["3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + python -m pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | diff --git a/ci/python-publish.yml b/ci/python-publish.yml deleted file mode 100644 index 4e1ef42d2b..0000000000 --- a/ci/python-publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/ci/ruby.yml b/ci/ruby.yml deleted file mode 100644 index 76c166ecbe..0000000000 --- a/ci/ruby.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake -# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby - -name: Ruby - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, - # change this to (see https://github.com/ruby/setup-ruby#versioning): - # uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 - with: - ruby-version: 2.6 - - name: Install dependencies - run: bundle install - - name: Run tests - run: bundle exec rake diff --git a/ci/rust.yml b/ci/rust.yml index 6738b0b292..cda1f64a62 100644 --- a/ci/rust.yml +++ b/ci/rust.yml @@ -2,9 +2,12 @@ name: Rust on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] + +env: + CARGO_TERM_COLOR: always jobs: build: @@ -12,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Run tests diff --git a/ci/scala.yml b/ci/scala.yml deleted file mode 100644 index f182d0c092..0000000000 --- a/ci/scala.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Scala CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Run tests - run: sbt test diff --git a/ci/swift.yml b/ci/swift.yml index 5dbdb4f34d..f2da0d0c9e 100644 --- a/ci/swift.yml +++ b/ci/swift.yml @@ -1,10 +1,13 @@ +# This workflow will build a Swift project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift + name: Swift on: push: - branches: [ master ] + branches: [ $default-branch ] pull_request: - branches: [ master ] + branches: [ $default-branch ] jobs: build: @@ -12,7 +15,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: swift build -v - name: Run tests diff --git a/ci/tencent.yml b/ci/tencent.yml deleted file mode 100644 index 2d4ad039aa..0000000000 --- a/ci/tencent.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow will build a docker container, publish and deploy it to Tencent Kubernetes Engine (TKE). -# -# To configure this workflow: -# -# 1. Ensure that your repository contains the necessary configuration for your Tencent Kubernetes Engine cluster, -# including deployment.yml, kustomization.yml, service.yml, etc. -# -# 2. Set up secrets in your workspace: -# - TENCENT_CLOUD_SECRET_ID with Tencent Cloud secret id -# - TENCENT_CLOUD_SECRET_KEY with Tencent Cloud secret key -# - TENCENT_CLOUD_ACCOUNT_ID with Tencent Cloud account id -# - TKE_REGISTRY_PASSWORD with TKE registry password -# -# 3. Change the values for the TKE_IMAGE_URL, TKE_REGION, TKE_CLUSTER_ID and DEPLOYMENT_NAME environment variables (below). - -name: Tencent Kubernetes Engine - -on: - release: - types: [created] - -# Environment variables available to all jobs and steps in this workflow -env: - TKE_IMAGE_URL: ccr.ccs.tencentyun.com/demo/mywebapp - TKE_REGION: ap-guangzhou - TKE_CLUSTER_ID: cls-mywebapp - DEPLOYMENT_NAME: tke-test - -jobs: - setup-build-publish-deploy: - name: Setup, Build, Publish, and Deploy - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - # Build - - name: Build Docker image - run: | - docker build -t ${TKE_IMAGE_URL}:${GITHUB_SHA} . - - - name: Login TKE Registry - run: | - docker login -u ${{ secrets.TENCENT_CLOUD_ACCOUNT_ID }} -p ${{ secrets.TKE_REGISTRY_PASSWORD }} ${TKE_IMAGE_URL} - - # Push the Docker image to TKE Registry - - name: Publish - run: | - docker push ${TKE_IMAGE_URL}:${GITHUB_SHA} - - - name: Set up Kustomize - run: | - curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 - chmod u+x ./kustomize - - - name: Set up ~/.kube/config for connecting TKE cluster - uses: TencentCloud/tke-cluster-credential-action@v1 - with: - secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }} - secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }} - tke_region: ${{ env.TKE_REGION }} - cluster_id: ${{ env.TKE_CLUSTER_ID }} - - - name: Switch to TKE context - run: | - kubectl config use-context ${TKE_CLUSTER_ID}-context-default - - # Deploy the Docker image to the TKE cluster - - name: Deploy - run: | - ./kustomize edit set image ${TKE_IMAGE_URL}:${GITHUB_SHA} - ./kustomize build . | kubectl apply -f - - kubectl rollout status deployment/${DEPLOYMENT_NAME} - kubectl get services -o wide \ No newline at end of file diff --git a/ci/terraform.yml b/ci/terraform.yml deleted file mode 100644 index 148f2e220f..0000000000 --- a/ci/terraform.yml +++ /dev/null @@ -1,90 +0,0 @@ -# This workflow installs the latest version of Terraform CLI and configures the Terraform CLI configuration file -# with an API token for Terraform Cloud (app.terraform.io). On pull request events, this workflow will run -# `terraform init`, `terraform fmt`, and `terraform plan` (speculative plan via Terraform Cloud). On push events -# to the master branch, `terraform apply` will be executed. -# -# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform -# -# To use this workflow, you will need to complete the following setup steps. -# -# 1. Create a `main.tf` file in the root of this repository with the `remote` backend and one or more resources defined. -# Example `main.tf`: -# # The configuration for the `remote` backend. -# terraform { -# backend "remote" { -# # The name of your Terraform Cloud organization. -# organization = "example-organization" -# -# # The name of the Terraform Cloud workspace to store Terraform state files in. -# workspaces { -# name = "example-workspace" -# } -# } -# } -# -# # An example resource that does nothing. -# resource "null_resource" "example" { -# triggers = { -# value = "A example resource that does nothing!" -# } -# } -# -# -# 2. Generate a Terraform Cloud user API token and store it as a GitHub secret (e.g. TF_API_TOKEN) on this repository. -# Documentation: -# - https://www.terraform.io/docs/cloud/users-teams-organizations/api-tokens.html -# - https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets -# -# 3. Reference the GitHub secret in step using the `hashicorp/setup-terraform` GitHub Action. -# Example: -# - name: Setup Terraform -# uses: hashicorp/setup-terraform@v1 -# with: -# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} - -name: 'Terraform' - -on: - push: - branches: - - master - pull_request: - -jobs: - terraform: - name: 'Terraform' - runs-on: ubuntu-latest - - # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest - defaults: - run: - shell: bash - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token - - name: Setup Terraform - uses: hashicorp/setup-terraform@v1 - with: - cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} - - # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - - name: Terraform Init - run: terraform init - - # Checks that all Terraform configuration files adhere to a canonical format - - name: Terraform Format - run: terraform fmt -check - - # Generates an execution plan for Terraform - - name: Terraform Plan - run: terraform plan - - # On push to master, build or change infrastructure according to Terraform configuration files - # Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks - - name: Terraform Apply - if: github.ref == 'refs/heads/master' && github.event_name == 'push' - run: terraform apply -auto-approve diff --git a/ci/webpack.yml b/ci/webpack.yml new file mode 100644 index 0000000000..1013845287 --- /dev/null +++ b/ci/webpack.yml @@ -0,0 +1,28 @@ +name: NodeJS with Webpack + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + npx webpack diff --git a/ci/wpf-dotnet-core.yml b/ci/wpf-dotnet-core.yml deleted file mode 100644 index 80ec3e5f0f..0000000000 --- a/ci/wpf-dotnet-core.yml +++ /dev/null @@ -1,115 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will build, test and package a WPF desktop application -# built on .NET Core. -# To learn how to migrate your existing WPF application to .NET Core, -# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework -# -# To configure this workflow: -# -# 1. Configure environment variables -# GitHub sets default environment variables for every workflow run. -# Replace the variables relative to your project in the "env" section below. -# -# 2. Signing -# Generate a signing certificate in the Windows Application -# Packaging Project or add an existing signing certificate to the project. -# Next, use PowerShell to encode the .pfx file using Base64 encoding -# by running the following Powershell script to generate the output string: -# -# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte -# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' -# -# Open the output file, SigningCertificate_Encoded.txt, and copy the -# string inside. Then, add the string to the repo as a GitHub secret -# and name it "Base64_Encoded_Pfx." -# For more information on how to configure your signing certificate for -# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing -# -# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". -# See "Build the Windows Application Packaging project" below to see how the secret is used. -# -# For more information on GitHub Actions, refer to https://github.com/features/actions -# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, -# refer to https://github.com/microsoft/github-actions-for-desktop-apps - -name: WPF .NET Core - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build: - - strategy: - matrix: - configuration: [Debug, Release] - - runs-on: windows-latest # For a list of available runner types, refer to - # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on - - env: - Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - # Install the .NET Core workload - - name: Install .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16 - - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test - - # Restore the WPF application to populate the obj folder with RuntimeIdentifiers - - name: Restore the WPF application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} - - # Decode the base 64 encoded pfx and save the Signing_Certificate - - name: Decode the pfx - run: | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") - $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx - [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) - - # Create the app package by building and packaging the Windows Application Packaging project - - name: Create the app package - run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} - env: - Appx_Bundle: Always - Appx_Bundle_Platforms: x86|x64 - Appx_Package_Build_Mode: StoreUpload - Configuration: ${{ matrix.configuration }} - - # Remove the pfx - - name: Remove the pfx - run: Remove-Item -path $env:Wap_Project_Directory\$env:Signing_Certificate - - # Upload the MSIX package: https://github.com/marketplace/actions/upload-artifact - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: MSIX Package - path: ${{ env.Wap_Project_Directory }}\AppPackages diff --git a/code-scanning/codeql.yml b/code-scanning/codeql.yml new file mode 100644 index 0000000000..39d0d8ee91 --- /dev/null +++ b/code-scanning/codeql.yml @@ -0,0 +1,97 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ $default-branch, $protected-branches ] + pull_request: + branches: [ $default-branch, $protected-branches ] + schedule: + - cron: $cron-weekly + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + $codeql-languages-matrix + # CodeQL supports the following values keywords for 'language': $supported-codeql-languages + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" diff --git a/code-scanning/properties/codeql.properties.json b/code-scanning/properties/codeql.properties.json new file mode 100644 index 0000000000..8aaa8f54be --- /dev/null +++ b/code-scanning/properties/codeql.properties.json @@ -0,0 +1,8 @@ +{ + "name": "CodeQL Analysis", + "creator": "GitHub", + "enterprise": true, + "description": "Security analysis from GitHub for C, C++, C#, Go, Java, JavaScript, TypeScript, Python, Ruby, Kotlin and Swift developers.", + "iconName": "octicon mark-github", + "categories": ["Code Scanning", "C", "C++", "C#", "Go", "Java", "JavaScript", "TypeScript", "Python", "Ruby", "Kotlin", "Swift"] +} diff --git a/icons/ada.svg b/icons/ada.svg new file mode 100644 index 0000000000..6a0d58fa62 --- /dev/null +++ b/icons/ada.svg @@ -0,0 +1,283 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/angular.svg b/icons/angular.svg deleted file mode 100644 index 466927452a..0000000000 --- a/icons/angular.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/aspdotnet.svg b/icons/aspdotnet.svg deleted file mode 100644 index 468a082816..0000000000 --- a/icons/aspdotnet.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/astro.svg b/icons/astro.svg new file mode 100644 index 0000000000..ff9dd54b54 --- /dev/null +++ b/icons/astro.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/icons/cmake.svg b/icons/cmake.svg new file mode 100644 index 0000000000..254fe0129b --- /dev/null +++ b/icons/cmake.svg @@ -0,0 +1,493 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/dart.svg b/icons/dart.svg deleted file mode 100644 index 1ceb716d52..0000000000 --- a/icons/dart.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/dotnetcore.svg b/icons/dotnetcore.svg deleted file mode 100644 index 6d31060b33..0000000000 --- a/icons/dotnetcore.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/elixir.svg b/icons/elixir.svg deleted file mode 100644 index bed439ead2..0000000000 --- a/icons/elixir.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/gatsby.svg b/icons/gatsby.svg new file mode 100644 index 0000000000..5578b06cb2 --- /dev/null +++ b/icons/gatsby.svg @@ -0,0 +1,7 @@ + + + Gatsby + + + + diff --git a/icons/generator-generic-ossf-slsa3-publish.svg b/icons/generator-generic-ossf-slsa3-publish.svg new file mode 100644 index 0000000000..ea7746896d --- /dev/null +++ b/icons/generator-generic-ossf-slsa3-publish.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/icons/go-ossf-slsa3-publish.svg b/icons/go-ossf-slsa3-publish.svg new file mode 100644 index 0000000000..ea7746896d --- /dev/null +++ b/icons/go-ossf-slsa3-publish.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/icons/gradle.svg b/icons/gradle.svg deleted file mode 100644 index 504b09033d..0000000000 --- a/icons/gradle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/grunt.svg b/icons/grunt.svg deleted file mode 100644 index ce8e4a6cf1..0000000000 --- a/icons/grunt.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/gulp.svg b/icons/gulp.svg deleted file mode 100644 index a99af85e85..0000000000 --- a/icons/gulp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/haskell.svg b/icons/haskell.svg deleted file mode 100644 index 02830e872f..0000000000 --- a/icons/haskell.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/hugo.svg b/icons/hugo.svg new file mode 100644 index 0000000000..ea72a6f51a --- /dev/null +++ b/icons/hugo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/icons/ibm.svg b/icons/ibm.svg deleted file mode 100644 index 3732033cec..0000000000 --- a/icons/ibm.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - -Created by potrace 1.16, written by Peter Selinger 2001-2019 - - - - - - - - - - - - diff --git a/icons/jekyll-tube.svg b/icons/jekyll-tube.svg new file mode 100644 index 0000000000..89dd55dce0 --- /dev/null +++ b/icons/jekyll-tube.svg @@ -0,0 +1 @@ + diff --git a/icons/makefile.svg b/icons/makefile.svg new file mode 100644 index 0000000000..694ad2e226 --- /dev/null +++ b/icons/makefile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/mdbook.svg b/icons/mdbook.svg new file mode 100644 index 0000000000..c61e0a6138 --- /dev/null +++ b/icons/mdbook.svg @@ -0,0 +1,17 @@ + + + + diff --git a/icons/nextjs.svg b/icons/nextjs.svg new file mode 100644 index 0000000000..c45d6e63fb --- /dev/null +++ b/icons/nextjs.svg @@ -0,0 +1,3 @@ + + + diff --git a/icons/nuxtjs.svg b/icons/nuxtjs.svg new file mode 100644 index 0000000000..bebded37c0 --- /dev/null +++ b/icons/nuxtjs.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/ruby-gems.svg b/icons/ruby-gems.svg deleted file mode 100644 index 6728ef5c33..0000000000 --- a/icons/ruby-gems.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/ruby.svg b/icons/ruby.svg deleted file mode 100644 index 68b0c8b2f9..0000000000 --- a/icons/ruby.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/scala.svg b/icons/scala.svg deleted file mode 100644 index 80c5b99904..0000000000 --- a/icons/scala.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/icons/tencentcloud.svg b/icons/tencentcloud.svg deleted file mode 100644 index af729a46ce..0000000000 --- a/icons/tencentcloud.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - 矩形 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/icons/terraform.svg b/icons/terraform.svg deleted file mode 100644 index 718fc0f4e5..0000000000 --- a/icons/terraform.svg +++ /dev/null @@ -1 +0,0 @@ -terraform-icon logo \ No newline at end of file diff --git a/icons/uwp.svg b/icons/uwp.svg deleted file mode 100644 index 644e2663f5..0000000000 --- a/icons/uwp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/xamarin.svg b/icons/xamarin.svg deleted file mode 100644 index ca3c4b73bc..0000000000 --- a/icons/xamarin.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/pages/astro.yml b/pages/astro.yml new file mode 100644 index 0000000000..b57db08926 --- /dev/null +++ b/pages/astro.yml @@ -0,0 +1,90 @@ +# Sample workflow for building and deploying an Astro site to GitHub Pages +# +# To get started with Astro see: https://docs.astro.build/en/getting-started/ +# +name: Deploy Astro site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +env: + BUILD_PATH: "." # default value when not using subfolders + # BUILD_PATH: subfolder + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }} + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + working-directory: ${{ env.BUILD_PATH }} + - name: Build with Astro + run: | + ${{ steps.detect-package-manager.outputs.runner }} astro build \ + --site "${{ steps.pages.outputs.origin }}" \ + --base "${{ steps.pages.outputs.base_path }}" + working-directory: ${{ env.BUILD_PATH }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ${{ env.BUILD_PATH }}/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/gatsby.yml b/pages/gatsby.yml new file mode 100644 index 0000000000..d6b0eef068 --- /dev/null +++ b/pages/gatsby.yml @@ -0,0 +1,97 @@ +# Sample workflow for building and deploying a Gatsby site to GitHub Pages +# +# To get started with Gatsby see: https://www.gatsbyjs.com/docs/quick-start/ +# +name: Deploy Gatsby site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +# Default to bash +defaults: + run: + shell: bash + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + with: + # Automatically inject pathPrefix in your Gatsby configuration file. + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: gatsby + - name: Restore cache + uses: actions/cache@v4 + with: + path: | + public + .cache + key: ${{ runner.os }}-gatsby-build-${{ hashFiles('public') }} + restore-keys: | + ${{ runner.os }}-gatsby-build- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Build with Gatsby + env: + PREFIX_PATHS: 'true' + run: ${{ steps.detect-package-manager.outputs.manager }} run build + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./public + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/hugo.yml b/pages/hugo.yml new file mode 100644 index 0000000000..3de5235a70 --- /dev/null +++ b/pages/hugo.yml @@ -0,0 +1,75 @@ +# Sample workflow for building and deploying a Hugo site to GitHub Pages +name: Deploy Hugo site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +# Default to bash +defaults: + run: + shell: bash + +jobs: + # Build job + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.124.1 + steps: + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Install Dart Sass + run: sudo snap install dart-sass + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Build with Hugo + env: + # For maximum backward compatibility with Hugo modules + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./public + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/jekyll-gh-pages.yml b/pages/jekyll-gh-pages.yml new file mode 100644 index 0000000000..88328bdded --- /dev/null +++ b/pages/jekyll-gh-pages.yml @@ -0,0 +1,51 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/mdbook.yml b/pages/mdbook.yml new file mode 100644 index 0000000000..0abd3f6e78 --- /dev/null +++ b/pages/mdbook.yml @@ -0,0 +1,60 @@ +# Sample workflow for building and deploying a mdBook site to GitHub Pages +# +# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html +# +name: Deploy mdBook site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: 0.4.36 + steps: + - uses: actions/checkout@v4 + - name: Install mdBook + run: | + curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh + rustup update + cargo install --version ${MDBOOK_VERSION} mdbook + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Build with mdBook + run: mdbook build + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./book + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/nextjs.yml b/pages/nextjs.yml new file mode 100644 index 0000000000..00ce5afdbc --- /dev/null +++ b/pages/nextjs.yml @@ -0,0 +1,93 @@ +# Sample workflow for building and deploying a Next.js site to GitHub Pages +# +# To get started with Next.js see: https://nextjs.org/docs/getting-started +# +name: Deploy Next.js site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages + uses: actions/configure-pages@v4 + with: + # Automatically inject basePath in your Next.js configuration file and disable + # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: next + - name: Restore cache + uses: actions/cache@v4 + with: + path: | + .next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Build with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next build + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./out + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/nuxtjs.yml b/pages/nuxtjs.yml new file mode 100644 index 0000000000..312f98a690 --- /dev/null +++ b/pages/nuxtjs.yml @@ -0,0 +1,90 @@ +# Sample workflow for building and deploying a Nuxt site to GitHub Pages +# +# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation +# +name: Deploy Nuxt site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages + uses: actions/configure-pages@v4 + with: + # Automatically inject router.base in your Nuxt configuration file and set + # target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: nuxt + - name: Restore cache + uses: actions/cache@v4 + with: + path: | + dist + .nuxt + key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }} + restore-keys: | + ${{ runner.os }}-nuxt-build- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Static HTML export with Nuxt + run: ${{ steps.detect-package-manager.outputs.manager }} run generate + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./dist + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/pages/properties/astro.properties.json b/pages/properties/astro.properties.json new file mode 100644 index 0000000000..bc7db05d05 --- /dev/null +++ b/pages/properties/astro.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Astro", + "description": "Deploy an Astro site.", + "iconName": "astro", + "categories": ["Pages", "Astro"] +} diff --git a/pages/properties/gatsby.properties.json b/pages/properties/gatsby.properties.json new file mode 100644 index 0000000000..df260f89ba --- /dev/null +++ b/pages/properties/gatsby.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Gatsby", + "description": "Package a Gatsby site.", + "iconName": "gatsby", + "categories": ["Pages", "Gatsby"] +} \ No newline at end of file diff --git a/pages/properties/hugo.properties.json b/pages/properties/hugo.properties.json new file mode 100644 index 0000000000..b6f6dc7c5c --- /dev/null +++ b/pages/properties/hugo.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Hugo", + "description": "Package a Hugo site.", + "iconName": "hugo", + "categories": ["Pages", "Hugo"] +} \ No newline at end of file diff --git a/pages/properties/jekyll-gh-pages.properties.json b/pages/properties/jekyll-gh-pages.properties.json new file mode 100644 index 0000000000..3e38602fae --- /dev/null +++ b/pages/properties/jekyll-gh-pages.properties.json @@ -0,0 +1,6 @@ +{ + "name": "GitHub Pages Jekyll", + "description": "Package a Jekyll site with GitHub Pages dependencies preinstalled.", + "iconName": "jekyll-tube", + "categories": ["Pages", "Jekyll"] +} diff --git a/pages/properties/mdbook.properties.json b/pages/properties/mdbook.properties.json new file mode 100644 index 0000000000..2a4fe8ded0 --- /dev/null +++ b/pages/properties/mdbook.properties.json @@ -0,0 +1,6 @@ +{ + "name": "mdBook", + "description": "Package a site using mdBook.", + "iconName": "mdbook", + "categories": ["Pages", "mdBook"] +} diff --git a/pages/properties/nextjs.properties.json b/pages/properties/nextjs.properties.json new file mode 100644 index 0000000000..42099089ed --- /dev/null +++ b/pages/properties/nextjs.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Next.js", + "description": "Package a Next.js site.", + "iconName": "nextjs", + "categories": ["Pages", "Next"] +} diff --git a/pages/properties/nuxtjs.properties.json b/pages/properties/nuxtjs.properties.json new file mode 100644 index 0000000000..d79909efb1 --- /dev/null +++ b/pages/properties/nuxtjs.properties.json @@ -0,0 +1,6 @@ +{ + "name": "NuxtJS", + "description": "Package a NuxtJS site.", + "iconName": "nuxtjs", + "categories": ["Pages", "Nuxt"] +} \ No newline at end of file diff --git a/pages/properties/static.properties.json b/pages/properties/static.properties.json new file mode 100644 index 0000000000..372579c094 --- /dev/null +++ b/pages/properties/static.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Static HTML", + "description": "Deploy static files in a repository without a build.", + "iconName": "html", + "categories": ["Pages", "HTML", "JavaScript", "CSS"] +} diff --git a/pages/static.yml b/pages/static.yml new file mode 100644 index 0000000000..43aa997552 --- /dev/null +++ b/pages/static.yml @@ -0,0 +1,43 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3