Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 'prerelease' into master #628

Merged
merged 33 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
de9fe12
Set AssemblyTitle
Arthurvdv May 6, 2024
5b7e0a5
Version as ENV variable
Arthurvdv May 6, 2024
2007e4f
Convert input to String
Arthurvdv May 6, 2024
4814e76
Set right input variable
Arthurvdv May 9, 2024
4a679bc
Disable Setup .NET step
Arthurvdv May 9, 2024
070a277
Merge pull request #610 from StefanMaron/AssemblyTitle
Arthurvdv May 9, 2024
0c342fa
Implement code singing of .dll artifact
Arthurvdv May 14, 2024
360c497
Merge pull request #612 from StefanMaron/ImplementCodeSignArtifacts
Arthurvdv May 14, 2024
cd6131c
Add missing if expression to upload-build-asset step
Arthurvdv May 14, 2024
33c92d2
Merge pull request #613 from StefanMaron/BuildWorkFlow
Arthurvdv May 14, 2024
4dfbe44
Add support for XmlPortDataItemAccess
Arthurvdv May 18, 2024
e3d8b37
Merge pull request #614 from StefanMaron/XmlPortDataItemAccess
Arthurvdv May 18, 2024
3b62847
Add logic for SplitButton with Repeater Scope
Arthurvdv May 18, 2024
41271e4
Format Document
Arthurvdv May 18, 2024
08688c8
Merge pull request #615 from StefanMaron/SplitButtonAndRepeaterScope
Arthurvdv May 18, 2024
546e518
Improve rule0005 to extend more keywords
Arthurvdv May 20, 2024
245c2e2
Merge pull request #616 from StefanMaron/ImproveRule0005
Arthurvdv May 20, 2024
a7fa8b7
Add AnalysePageActionAreas to rule0005
Arthurvdv May 20, 2024
1670341
Merge pull request #617 from StefanMaron/AnalysePageActionAreas
Arthurvdv May 20, 2024
abfb5cc
Improve performance by implementing RegisterSyntaxNodeAction
Arthurvdv May 21, 2024
c20a1ff
Merge pull request #618 from StefanMaron/RegisterSyntaxNodeAction
Arthurvdv May 21, 2024
f1fe5b9
Implement PredefinedActionCategoryNames from SyntaxFacts
Arthurvdv May 21, 2024
578937a
Merge pull request #619 from StefanMaron/PredefinedActionCategoryNames
Arthurvdv May 21, 2024
d50893c
Implement Trigger Declarations
Arthurvdv May 22, 2024
7e1ccc3
Merge pull request #621 from StefanMaron/AnalyzeTriggerDeclaration
Arthurvdv May 22, 2024
49776f8
Add TryCatch to investigate InvalidCastException
Arthurvdv May 23, 2024
422d0ae
Resolve typo
Arthurvdv May 23, 2024
ee98f89
Merge pull request #623 from StefanMaron/TryCatch
Arthurvdv May 23, 2024
250567a
Exclude tokens with an empty string value
Arthurvdv May 23, 2024
79c59d6
Resolve InvalidCastException
Arthurvdv May 23, 2024
a7f1c56
Merge pull request #624 from StefanMaron/InvalidCastException
Arthurvdv May 23, 2024
9dd053f
Some small bugfixes
Arthurvdv May 23, 2024
6cd085f
Merge pull request #625 from StefanMaron/SmallImprovements
Arthurvdv May 23, 2024
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
170 changes: 117 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ jobs:

outputs:
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
release-id: ${{ steps.create-release.outputs.id }}
release-tag-name: ${{ steps.create-release.outputs.tag_name }}
release-upload-url: ${{ steps.create-release.outputs.upload_url }}

matrix-job:
name: Build
Expand All @@ -151,8 +149,12 @@ jobs:
steps:
- uses: actions/checkout@v4

# Disable Setup .NET
# dotnet-install: .NET Core Runtime with version '8.0.4' is already installed.
# dotnet-install: .NET Core SDK with version '8.0.204' is already installed.
- name: Setup .NET
uses: actions/setup-dotnet@v4
if: false
with:
dotnet-version: 8.0.*

Expand All @@ -166,77 +168,139 @@ jobs:
- name: Unzip vsix
run: 7z x ALLanguage.vsix "-oms-dynamics-smb.al-latest" extension/bin/Analyzers -r

- name: Set current version
- name: Set AssemblyInfo
shell: pwsh
if: ${{ matrix.GH_eventName != 'pull_request' }}
env:
AL_VERSION: ${{ matrix.version }}
run: (Get-Content AssemblyInfo.cs) -replace 'Version\("([\d\.]+)"\)]',
("Version(""" + ('${{ needs.setup-matrix.outputs.release-tag-name }}'
-replace "v","") + """)]") | Out-File AssemblyInfo.cs

(Get-Content AssemblyInfo.cs) -replace 'AssemblyTitle\("([^"]*)"\)', "AssemblyTitle(`"AL-$env:AL_VERSION`")" | Out-File AssemblyInfo.cs

- name: Build
run: dotnet build /p:FeatureFlags=${{ matrix.featureflags }} --no-restore --configuration Release

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
- name: Upload build artifact
id: upload-build-asset
uses: actions/upload-artifact@v4
if: ${{ matrix.GH_eventName != 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.setup-matrix.outputs.release-upload-url }}
asset_path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
asset_name: ${{ matrix.assetname }}
asset_content_type: application/octet-stream

### Release Asset as Latest
- name: Upload Release Asset (Latest)
id: upload-release-asset-latest
uses: actions/upload-release-asset@v1
name: ${{ matrix.assetname }}
path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
compression-level: 0 # no compression

### Upload Asset as Latest
- name: Upload build artifact (Latest)
id: upload-build-asset-latest
uses: actions/upload-artifact@v4
if: ${{ matrix.GH_eventName != 'pull_request' && matrix.latest }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.setup-matrix.outputs.release-upload-url }}
asset_path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
asset_name: BusinessCentral.LinterCop.dll
asset_content_type: application/octet-stream

### Release Asset as Pre-Release
- name: Upload Release Asset (Pre-Release)
id: upload-release-asset-prerelease
uses: actions/upload-release-asset@v1
name: BusinessCentral.LinterCop.dll
path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
compression-level: 0 # no compression

### Upload Asset as Pre-Release
- name: Upload build artifact (Pre-Release)
id: upload-build-asset-prerelease
uses: actions/upload-artifact@v4
if: ${{ matrix.GH_eventName != 'pull_request' && matrix.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.setup-matrix.outputs.release-upload-url }}
asset_path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
asset_name: BusinessCentral.LinterCop.AL-PreRelease.dll
asset_content_type: application/octet-stream
name: BusinessCentral.LinterCop.AL-PreRelease.dll
path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
compression-level: 0 # no compression

### Compatibility with previous naming of files
### Release Asset as Current
- name: Upload Release Asset (Current)
id: upload-release-asset-current
uses: actions/upload-release-asset@v1
- name: Upload build artifact (Current)
id: upload-build-asset-current
uses: actions/upload-artifact@v4
if: ${{ matrix.GH_eventName != 'pull_request' && matrix.latest }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.setup-matrix.outputs.release-upload-url }}
asset_path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
asset_name: BusinessCentral.LinterCop.current.dll
asset_content_type: application/octet-stream

### Release Asset as Next
- name: Upload Release Asset (Next)
id: upload-release-asset-next
uses: actions/upload-release-asset@v1
name: BusinessCentral.LinterCop.current.dll
path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
compression-level: 0 # no compression

# ### Release Asset as Next
- name: Upload build artifact (Next)
id: upload-build-asset-next
uses: actions/upload-artifact@v4
if: ${{ matrix.GH_eventName != 'pull_request' && matrix.prerelease }}
with:
name: BusinessCentral.LinterCop.next.dll
path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
compression-level: 0 # no compression

sign-job:
name: Sign
runs-on: windows-latest # Code signing must run on a Windows agent for Authenticode signing (dll/exe)
permissions:
id-token: write # Required for requesting the JWT
contents: write # Required for Uploading Release Assets with GitHub CLI (gh release upload)
needs:
- setup-matrix
- matrix-job
if: github.event_name != 'pull_request' # Exclude this job for validation on the pull-request
steps:
# Disable Setup .NET
# dotnet-install: .NET Core Runtime with version '8.0.4' is already installed.
# dotnet-install: .NET Core SDK with version '8.0.204' is already installed.
- name: Setup .NET
uses: actions/setup-dotnet@v4
if: false
with:
dotnet-version: 8.0.*

# Install the code signing tool
- name: Install Sign CLI tool
run: dotnet tool install --tool-path . sign --version 0.9.0-beta.23127.3

# Download artifacts
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: DownloadArtifacts

# Rename artifacts
- name: Rename artifacts
run: |
# Get list of artifacts files
$artifacts = Get-ChildItem -Path DownloadArtifacts -Recurse | ForEach-Object { if (!($_.PSIsContainer)) { $_}} | Where-Object { $_.Name -like 'BusinessCentral.LinterCop*.dll' -and $_.Directory.Name -like 'BusinessCentral.LinterCop*.dll' }

# Create folder if not exits
if (!(Test-Path BuildArtifacts)) {
New-Item -Path BuildArtifacts -ItemType Directory -Force | Out-Null
}

# Move the artifacts (BusinessCentral.LinterCop.dll) in every directory to a combined folder and rename the file to the name of it's parent directory
$artifacts | ForEach-Object { Move-Item -Path $_ -Destination (Join-Path 'BuildArtifacts' $_.Directory.Name) }

- name: "Azure Login"
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

# Run the signing command
- name: Sign artifacts
shell: pwsh
run: >
./sign code azure-key-vault
**/*.dll
--base-directory "${{ github.workspace }}\BuildArtifacts"
--description "BusinessCentral.LinterCop"
--description-url "https://github.com/StefanMaron/BusinessCentral.LinterCop"
--azure-key-vault-managed-identity true
--azure-key-vault-url "${{ secrets.KEY_VAULT_URL }}"
--azure-key-vault-certificate "${{ secrets.KEY_VAULT_CERTIFICATE }}"

# Publish the signed packages
- name: Upload Release Assets
id: upload-release-assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.setup-matrix.outputs.release-upload-url }}
asset_path: bin/Release/netstandard2.1/BusinessCentral.LinterCop.dll
asset_name: BusinessCentral.LinterCop.next.dll
asset_content_type: application/octet-stream
GITHUB_REPO: ${{ github.repository }}
RELEASE_TAG_NAME: ${{ needs.setup-matrix.outputs.release-tag-name }}
run: |
$artifacts = Get-ChildItem -Path BuildArtifacts -Depth 0 -Filter *.dll
$artifacts | ForEach-Object { gh release upload --repo "$env:GITHUB_REPO" "$env:RELEASE_TAG_NAME" "$_" }
Binary file modified AssemblyInfo.cs
Binary file not shown.
Loading