Skip to content

Commit

Permalink
Merge Add pre-release and update release action
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-b authored Oct 16, 2024
2 parents 24d01db + 9b4e18c commit f4e0fcd
Show file tree
Hide file tree
Showing 12 changed files with 449 additions and 272 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ indent_size = 2

[{*.ts,*.js}]
indent_size = 2

[*.yml]
indent_size = 2

[*.sh]
end_of_line = lf
79 changes: 79 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# By default text files use native line endings for the platform
* text=auto

# Visual Studio solution and project files
*.sln text
*.csproj text
*.fsproj text
*.rptproj text
*.sqlproj text
*.wixproj text

# Source files
*.cmd text
*.config text
*.cs text
*.datasource text
*.disco text
*.edmx text
*.fs text
*.html text
*.manifest text
*.md text
*.nuspec text
*.ps1 text
*.psess text
*.rdl text
*.rds text
*.resx text
*.settings text
*.sql text
*.svc text
*.svcmap text
*.targets text
*.tt text
*.ttinclude text
*.t4 text
*.txt text
*.wdsl text
*.xaml text
*.xml text
*.XML text
*.xsd text

# Images
*.bmp binary
*.gif binary
*.ico binary
*.jpg binary
*.png binary

# Binaries
*.dll binary
*.eap binary
*.exe binary
*.msi binary
*.nuget binary
*.pdb binary
*.snk binary
*.zip binary

# Other files, probably binary
*.data binary
*.dacpac binary
*.map binary
*.tbx binary
*.mpkx binary
*.aprx binary

# Common document formats
*.csv text eol=crlf
*.doc binary
*.docx binary
*.pdf binary
*.rtf text eol=crlf
*.svg text eol=lf

# *nix shell scripts always use LF (see .editorconfig)
*.sh text eol=lf
CHANGELOG.md text eol=lf
64 changes: 64 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Pre-release

on:
push:
branches:
- master
workflow_dispatch:

jobs:
pre-release:
runs-on: ubuntu-latest
name: Build vsix and upload to GitHub pre-release

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0"

- name: Get current version
run: |
VERSION=$(node -p "require('./package.json').version")
echo VERSION=$VERSION >> $GITHUB_ENV
echo VERSION_TAG=v$VERSION-${{ github.run_number }} >> $GITHUB_ENV
- name: Add GitHub NuGet Registry
run: dotnet nuget add source --username "${{ github.actor }}" --password "%GITHUB_TOKEN%" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GeoWerkstatt/index.json"

- name: Restore packages
run: dotnet restore ./language-server/src
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build language-server
run: dotnet build --no-restore "-p:VersionPrefix=${{ env.VERSION }}" ./language-server/src

- name: Run language-server tests
run: dotnet test --no-build ./language-server/src

- name: Publish language-server
run: |
for rid in win-x64 linux-x64 osx-x64
do
dotnet publish ./language-server/src/Geowerkstatt.Interlis.LanguageServer --self-contained -c Release -r $rid "-p:VersionPrefix=${{ env.VERSION }}" -o ./language-server/bin/$rid
done
- name: Install packages
run: npm ci

- name: Pack extension
run: npx vsce pack --pre-release

- name: Create GitHub pre-release
run: gh release create ${{ env.VERSION_TAG }} --title "${{ env.VERSION_TAG }}" --notes "$(./get-changelog.sh)" --prerelease --target ${{ github.ref }} *.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139 changes: 74 additions & 65 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,97 @@
name: Release

on:
pull_request:
branches:
- master
types: [closed]
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: "Tag name"
required: true

env:
VERSION_TAG: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}

jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
name: Publish vsix

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0"

- name: Get current version
run: |
VERSION=$(node -p "require('./package.json').version")
echo VERSION=$VERSION >> $GITHUB_ENV
echo VERSION_TAG=v$VERSION >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0"

- name: Check if tag exists
id: check_tag
run: echo PERFORM_PUBLISH=$(git rev-parse --verify -q "refs/tags/${{ env.VERSION_TAG }}" >> /dev/null && echo false || echo true) >> $GITHUB_ENV
- name: Set environment variables
run: |
VERSION_TMP=${VERSION_TAG#v} # Remove the 'v' prefix
VERSION=${VERSION_TMP%-*} # Remove the '-' build number suffix
echo VERSION=$VERSION >> $GITHUB_ENV
echo GIT_BRANCH_NAME=mark-version-$VERSION-as-released >> $GITHUB_ENV
echo GIT_COMMIT_MESSAGE=Mark version $VERSION as released >> $GITHUB_ENV
- name: Add GitHub NuGet Registry
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: dotnet nuget add source --username "GeoWerkstatt-Build" --password "%GITHUB_TOKEN%" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GeoWerkstatt/index.json"
- name: Add GitHub NuGet Registry
run: dotnet nuget add source --username "${{ github.actor }}" --password "%GITHUB_TOKEN%" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GeoWerkstatt/index.json"

- name: Restore packages
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: dotnet restore ./language-server/src
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore packages
run: dotnet restore ./language-server/src
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build language-server
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: dotnet build --no-restore "-p:VersionPrefix=${{ env.VERSION }}" ./language-server/src
- name: Build language-server
run: dotnet build --no-restore "-p:VersionPrefix=${{ env.VERSION }}" ./language-server/src

- name: Run language-server tests
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: dotnet test --no-build ./language-server/src
- name: Run language-server tests
run: dotnet test --no-build ./language-server/src

- name: Publish language-server
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: |
- name: Publish language-server
run: |
for rid in win-x64 linux-x64 osx-x64
do
dotnet publish ./language-server/src/Geowerkstatt.Interlis.LanguageServer --self-contained -c Release -r $rid "-p:VersionPrefix=${{ env.VERSION }}" -o ./language-server/bin/$rid
done
- name: Install packages
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: npm ci
- name: Install packages
run: npm ci

- name: Patch changelog
run: sed -i "s/vNext/$VERSION - $(date '+%Y-%m-%d')/" CHANGELOG.md

- name: Pack extension
run: npx vsce pack --no-git-tag-version ${{ env.VERSION }}

- name: Publish extension to marketplace
run: npx vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Update GitHub release assets
run: gh release upload ${{ env.VERSION_TAG }} *.vsix --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add vNext to changelog
run: sed -i "/^\#\#\# $VERSION/i \#\#\# vNext\n\n" CHANGELOG.md

- name: Publish extension
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: npx vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Patch package.json version
run: npm version patch --git-tag-version false

- name: Tag current version
if: ${{ env.PERFORM_PUBLISH == 'true' }}
run: |
- name: Commit, push and create pull request
run: |
git config --local user.email "[email protected]"
git config --local user.name "GeoWerkstatt-Build"
git tag ${{ env.VERSION_TAG }}
- name: Push version tag
if: ${{ env.PERFORM_PUBLISH == 'true' }}
uses: ad-m/github-push-action@057a6ba835d986bfe495dd476a6c4db1d5f9503c
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
git checkout -b $GIT_BRANCH_NAME
git commit -am "$GIT_COMMIT_MESSAGE"
git push --set-upstream origin $GIT_BRANCH_NAME
gh pr create --title "$GIT_COMMIT_MESSAGE" --body ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64 changes: 32 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Change Log
### vNext

* Add _Generate markdown documentation_ command using language server.

### 0.1.6 - 14.10.2022

* Fix _Go to Implementation_ not retrieving Models in subrepositories.

### 0.1.5 - 12.10.2022

* Rework TextMate grammar to separate included types from keywords
* Add _Go to Implementation_ functionality for VSCode desktop

### 0.1.4 - 18.10.2021

* Include syntax highlighting for block comments

### 0.1.3 - 15.07.2021

* Include snippets
* Higher resolution logo

### 0.1.2 - 21.05.2021

* Automate deployment via GitHub
* Fix typo in VIEW configuration

### 0.1.0 - 12.04.2021

* Added coloring of INTERLIS 2 Keywords.

# Change Log
### vNext

* Add _Generate markdown documentation_ command using language server.

### 0.1.6 - 14.10.2022

* Fix _Go to Implementation_ not retrieving Models in subrepositories.

### 0.1.5 - 12.10.2022

* Rework TextMate grammar to separate included types from keywords
* Add _Go to Implementation_ functionality for VSCode desktop

### 0.1.4 - 18.10.2021

* Include syntax highlighting for block comments

### 0.1.3 - 15.07.2021

* Include snippets
* Higher resolution logo

### 0.1.2 - 21.05.2021

* Automate deployment via GitHub
* Fix typo in VIEW configuration

### 0.1.0 - 12.04.2021

* Added coloring of INTERLIS 2 Keywords.

Loading

0 comments on commit f4e0fcd

Please sign in to comment.