Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/compiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- cron: '0 0 * * 0'

jobs:
main:
pack:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: 1
Expand All @@ -28,7 +28,7 @@ jobs:
shell: pwsh
run: dotnet pack PascalABC.NET.Compiler --output nupkg

- name: Upload artifact
- name: Upload the artifact
uses: actions/upload-artifact@v3
with:
name: compiler-package
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Pack the SDK

on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0'

jobs:
pack:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Read version from Git ref
if: startsWith(github.ref, 'refs/tags/v')
id: version
shell: pwsh
run: Write-Output "::set-output name=version::$($env:GITHUB_REF -replace '^refs/tags/v', '')"

- name: Fetch the sources
uses: actions/checkout@v2

- name: Set up .NET 6.0 SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Pack
shell: pwsh
run: dotnet pack PascalABC.NET.SDK --output nupkg

- name: Read the changelog
uses: ForNeVeR/ChangelogAutomation.action@v1
with:
input: ./CHANGELOG.md
output: ./changelog-section.md

- name: Upload the artifact
uses: actions/upload-artifact@v3
with:
name: sdk-package
path: nupkg/*.nupkg

- name: Upload the changelog
uses: actions/upload-artifact@v2
with:
name: changelog-section.md
path: ./changelog-section.md

- name: Create the release
if: startsWith(github.ref, 'refs/tags/v')
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: PascalABC.NET SDK v${{ steps.version.outputs.version }}
body_path: ./changelog-section.md

- name: Upload the distribution to the releases page
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: FVNever.PascalABC.NET.SDK.${{ steps.version.outputs.version }}.nupkg
asset_path: ./nupkg/FVNever.PascalABC.NET.SDK.${{ steps.version.outputs.version }}.nupkg
asset_content_type: application/zip

- name: Push to NuGet
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.SDK_NUGET_TOKEN }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Changelog
=========

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-09-17
This is the initial release of the SDK. It allows invoking the compiler to build simple PascalABC.NET programs.

[1.0.0]: https://github.com/ForNeVeR/PascalABC.NET.SDK/releases/tag/v1.0.0
[Unreleased]: https://github.com/ForNeVeR/PascalABC.NET.SDK/compare/v1.0.0...HEAD

15 changes: 15 additions & 0 deletions MAINTAINERSHIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ Publishing the Compiler Package

[actions.compiler]: https://github.com/ForNeVeR/PascalABC.NET.SDK/actions/workflows/compiler.yml
[license]: https://github.com/pascalabcnet/pascalabcnet/tree/HEAD/doc

Publishing the SDK Package
--------------------------

1. Update the copyright year in the `LICENSE.md`, if required.
2. Choose a new version according to [Semantic Versioning][semver].
3. Update the package version in the following places:
- `PascalABC.NET.SDK/PascalABC.NET.SDK.proj` (the `VersionPrefix` element)
- `README.md` (the example section, look for `Sdk=`)
- `PascalABC.NET.SDK.Demo/PascalABC.NET.SDK.Demo.pasproj` (line 1)
4. Make sure there's a properly formed version entry in the `CHANGELOG.md` (often it can be created by renaming the **Unreleased** section).
5. Merge the changes to the `main` branch via a pull request.
6. Push a tag named `v<VERSION>` to GitHub.

[semver]: https://semver.org/spec/v2.0.0.html
2 changes: 1 addition & 1 deletion PascalABC.NET.SDK.Demo/PascalABC.NET.SDK.Demo.pasproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="FVNever.PascalABC.NET.SDK/0.0.1-dev">
<Project Sdk="FVNever.PascalABC.NET.SDK/1.0.0-dev">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
Expand Down
2 changes: 2 additions & 0 deletions PascalABC.NET.SDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
NuGet.config = NuGet.config
Directory.Build.props = Directory.Build.props
MAINTAINERSHIP.md = MAINTAINERSHIP.md
CHANGELOG.md = CHANGELOG.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{824BE205-E976-4553-AD61-C84F84A743B7}"
Expand All @@ -29,6 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
ProjectSection(SolutionItems) = preProject
.github\workflows\main.yml = .github\workflows\main.yml
.github\workflows\compiler.yml = .github\workflows\compiler.yml
.github\workflows\sdk.yml = .github\workflows\sdk.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PascalABC.NET.Compiler", "PascalABC.NET.Compiler\PascalABC.NET.Compiler.proj", "{E782654F-67C0-4D79-8C07-6548501C9187}"
Expand Down
13 changes: 10 additions & 3 deletions PascalABC.NET.SDK/PascalABC.NET.SDK.proj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.Build.NoTargets">

<PropertyGroup Label="Versioning">
<VersionPrefix>0.0.1</VersionPrefix>
<VersionPrefix>1.0.0</VersionPrefix>
</PropertyGroup>

<PropertyGroup Label="Packaging">
Expand All @@ -14,8 +14,15 @@
</PropertyGroup>

<ItemGroup>
<Content Include="Sdk\Sdk.props" PackagePath="Sdk\Sdk.props" />
<Content Include="Sdk\Sdk.targets" PackagePath="Sdk\Sdk.targets" />
<Content Include="Sdk\Sdk.props" PackagePath="Sdk\Sdk.props"/>
<Content Include="Sdk\Sdk.targets" PackagePath="Sdk\Sdk.targets"/>
<Content Include="..\CHANGELOG.md" PackagePath="docs\CHANGELOG.md"/>
<Content Include="..\LICENSE.md" PackagePath="docs\LICENSE.md"/>
<Content Include="..\README.md" PackagePath="docs\README.md"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="ChangelogAutomation.MSBuild" Version="1.0.1" PrivateAssets="All" />
</ItemGroup>

</Project>
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PascalABC.NET SDK [![Status Umbra][status-umbra]][andivionian-status-classifier]
PascalABC.NET SDK [![Status Enfer][status-enfer]][andivionian-status-classifier]
=================

This is an MSBuild SDK for [PascalABC.NET][pascalabc.net] programming language.
Expand All @@ -7,6 +7,7 @@ NuGet
-----

`FVNever.PascalABC.NET.Compiler`: [![NuGet Package][nuget.compiler.badge]][nuget.compiler.package]
`FVNever.PascalABC.NET.SDK`: [![NuGet Package][nuget.sdk.badge]][nuget.sdk.package]

Usage
-----
Expand All @@ -18,32 +19,25 @@ Usage

### Quick Start

1. Download the SDK sources (i.e. the sources of this project).
2. Pack the SDK package via the following shell command:
Prepare the following project file (`.pasproj` extension is recommended):

```console
$ dotnet pack PascalABC.NET.SDK --out nupkg
```
3. Make sure the `nupkg` directory is added to your project as a NuGet source.
4. Prepare the following project file (`.pasproj` extension is recommended):
```xml
<Project Sdk="FVNever.PascalABC.NET.SDK/1.0.0">

```xml
<Project Sdk="FVNever.PascalABC.NET.SDK/0.0.1-dev">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<ItemGroup>
<MainCompile Include="Hello.pas" />
</ItemGroup>

<ItemGroup>
<MainCompile Include="Hello.pas" />
</ItemGroup>

</Project>
```
</Project>
```

where `Hello.pas` is your main Pascal module.
where `Hello.pas` is your main Pascal module.

After that, `dotnet build` should build the PascalABC.NET project.
After that, `dotnet build` should build the PascalABC.NET project; see the output in the `bin` directory.

See the `PascalABC.NET.SDK.Demo` project for details.

Expand Down Expand Up @@ -73,7 +67,6 @@ To run the unit testing suite, first publish the development packages using this
$ pwsh ./scripts/build-packages.ps1
```


To execute the tests, run the following shell command:

```console
Expand All @@ -83,16 +76,20 @@ $ dotnet test PascalABC.NET.SDK.Tests
Documentation
-------------

- [Changelog][docs.changelog]
- [License (MIT)][docs.license]
- [Maintainership][docs.maintainership]

[andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier#status-umbra-
[andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier#status-enfer-
[docs.license]: LICENSE.md
[docs.maintainership]: MAINTAINERSHIP.md
[dotnet.changelog]: CHANGELOG.md
[dotnet.sdk]: https://dotnet.microsoft.com/en-us/download
[nuget.compiler.badge]: https://img.shields.io/nuget/v/FVNever.PascalABC.NET.Compiler/
[nuget.compiler.package]: https://www.nuget.org/packages/FVNever.PascalABC.NET.Compiler/
[nuget.sdk.badge]: https://img.shields.io/nuget/v/FVNever.PascalABC.NET.SDK/
[nuget.sdk.package]: https://www.nuget.org/packages/FVNever.PascalABC.NET.SDK/
[pascalabc.net.downloads]: http://pascalabc.net/en/download
[pascalabc.net]: http://pascalabc.net/en/
[powershell]: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.2
[status-umbra]: https://img.shields.io/badge/status-umbra-red.svg
[status-enfer]: https://img.shields.io/badge/status-enfer-orange.svg
Empty file added nupkg/.gitkeep
Empty file.