Git Product home page Git Product logo

sampsharp-build's Introduction

SampSharp-build

SampSharp shared build script code. Can possibly also be used with projects other than SampSharp.

Setup

  1. Stick the contents of the root directory into the root of your project
  2. Configure build.cake in your project root
  3. Add this repository as a submodule using git submodule add https://github.com/ikkentim/SampSharp-build.git cake
  4. Add tools/ to your .gitignore
  5. Add the following environment variables to the AppVeyor settings for your repository:
  • NUGET_KEY: The NuGet key to publish with
  • GITHUB_TOKEN: The GitHub token to use to publish a release
  1. Make sure your projects are at src/PROJECTNAME/PROJECTNAME.csproj
  2. Install the dotnet-cake tool: dotnet tool install Cake.Tool
  3. Add a GitHub Action to the project
  4. Make sure your project is configured to build (in release mode) to repo-root/bin
  5. Add the following to your csproj files:
    <!-- Add to the default ProjectGroup -->
    <Version>0.0.0-localbuild</Version>
    <AssemblyVersion>0.0.0</AssemblyVersion>
    <PackageReleaseNotes>placeholder</PackageReleaseNotes>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

  <!-- Add to Project -->
  <PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
     <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
  </ItemGroup>

GitHub Action

This template works as a good base, you possibly need to tweak it.

name: Cake
on:
  push:
    branches: [ master ]
    paths:
      - src/**
      - CHANGES.md

  pull_request:
    branches: [ master ]
    paths:
      - .github/workflows
      - src/**
      - CHANGES.md

  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Checkout submodules
        run: git submodule update --init --recursive

      - name: Run the Cake script
        uses: cake-build/cake-action@v1
        with:
          script-path: build.cake
          target: CI

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: nuget-packages
          path: |
            bin/Release/*.nupkg
            bin/**/*.dll
            bin/**/*.pdb
            bin/**/*.xml

Building

  • Run dotnet cake to build.

Creating New Releases

  1. Update your CHANGES.md (see versioning).
  2. Create a git tag: git tag <TAG>. If you want to create a prerelease, use <VERSION>-alpha as tag. You can also number your prereleases like <VERSION>-alpha2.
  3. Push your tags, git push --tags and the GitHub Action will take care of the rest.

Example of usage: ikkentim/SampSharp

sampsharp-build's People

Contributors

ikkentim avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

zelyutin-gta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.