Skip to content

Commit be7f69c

Browse files
committed
Bump over to github workflows. :/
1 parent 7061b5d commit be7f69c

File tree

4 files changed

+113
-63
lines changed

4 files changed

+113
-63
lines changed

.appveyor.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
build:
15+
runs-on: windows-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup .NET 8
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '8.0.x'
26+
27+
- name: Setup .NET 9
28+
uses: actions/setup-dotnet@v4
29+
with:
30+
dotnet-version: '9.0.x'
31+
32+
- name: Cache NuGet packages
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
~/.nuget/packages
37+
**/packages.config
38+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/packages.config') }}
39+
restore-keys: |
40+
${{ runner.os }}-nuget-
41+
42+
- name: Determine version
43+
id: version
44+
shell: bash
45+
run: |
46+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
47+
TAG_NAME=${GITHUB_REF#refs/tags/}
48+
TAG_NAME=${TAG_NAME#v}
49+
VERSION="${TAG_NAME}.${GITHUB_RUN_NUMBER}"
50+
else
51+
VERSION="2.1.0.${GITHUB_RUN_NUMBER}"
52+
fi
53+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
54+
55+
- name: Restore
56+
run: dotnet restore CoreJ2K.sln
57+
58+
- name: Build
59+
run: dotnet build CoreJ2K.sln -c Release --no-restore
60+
61+
- name: Pack
62+
run: |
63+
dotnet pack CoreJ2K.sln -c Release --no-build -o ./artifacts /p:Version=${{ steps.version.outputs.VERSION }} /p:PackageVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
64+
65+
- name: Upload packages (artifact)
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: nuget-packages
69+
path: artifacts/*.nupkg
70+
71+
publish:
72+
needs: build
73+
runs-on: windows-latest
74+
if: startsWith(github.ref, 'refs/tags/')
75+
steps:
76+
- name: Download packages
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: nuget-packages
80+
81+
- name: Push to NuGet.org
82+
env:
83+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
84+
run: |
85+
for pkg in $(ls artifacts/*.nupkg 2>/dev/null || true); do
86+
dotnet nuget push "$pkg" -k "$NUGET_API_KEY" -s https://api.nuget.org/v3/index.json --skip-duplicate
87+
done
88+
89+
- name: Create GitHub Release
90+
id: create_release
91+
uses: actions/create-release@v1
92+
with:
93+
tag_name: ${{ github.ref_name }}
94+
release_name: Release ${{ github.ref_name }}
95+
body: Release ${{ steps.version.outputs.VERSION }}
96+
draft: false
97+
prerelease: false
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
101+
- name: Upload Release Assets
102+
uses: actions/upload-release-asset@v1
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
with:
106+
upload_url: ${{ steps.create_release.outputs.upload_url }}
107+
asset_path: artifacts
108+
asset_name: corej2k-packages-${{ steps.version.outputs.VERSION }}.zip
109+
asset_content_type: application/zip

CoreJ2K.sln

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.12.35707.178
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.1.11312.151 d18.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platform", "Platform", "{3F4353EB-578D-416C-88B4-CA4B94ED9214}"
77
EndProject
@@ -13,7 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreJ2K", "CoreJ2K\CoreJ2K.
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9AE6461C-EC2B-4782-A41F-87358FEC8F77}"
1515
ProjectSection(SolutionItems) = preProject
16-
.appveyor.yml = .appveyor.yml
1716
CoreJ2K.png = CoreJ2K.png
1817
Directory.Build.props = Directory.Build.props
1918
README.md = README.md

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ A Managed and Portable JPEG2000 Codec for .NET Platforms
77

88
****
99

10-
[![NuGet](https://img.shields.io/nuget/v/CoreJ2K.svg?label=CoreJ2K&logo=nuget)](https://www.nuget.org/packages/CoreJ2K/)
10+
[![NuGet](https://img.shields.io/nuget/v/CoreJ2K.svg?label=CoreJ2K&logo=nuget)](https://www.nuget.org/packages/CoreJ2K/)
1111
[![Downloads](https://img.shields.io/nuget/dt/CoreJ2K?label=Downloads&logo=nuget)](https://www.nuget.org/packages/CoreJ2K/)
12-
[![Build](https://ci.appveyor.com/api/projects/status/9fr2467p5wxt6qxx?svg=true)](https://ci.appveyor.com/project/cinderblocks57647/corej2k)
1312
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](http://www.opensource.org/licenses/bsd-license.php)
13+
[![CI and Release](https://github.com/cinderblocks/CoreJ2K/actions/workflows/ci-and-release.yml/badge.svg)](https://github.com/cinderblocks/CoreJ2K/actions/workflows/ci-and-release.yml)
1414
[![Socket Badge](https://badge.socket.dev/nuget/package/corej2k)](https://badge.socket.dev/nuget/package/corej2k)
1515

1616
---

0 commit comments

Comments
 (0)