Skip to content

Commit

Permalink
Merge branch 'fix-CreateRelease' of https://github.com/mazhelez/AL-Go
Browse files Browse the repository at this point in the history
…into fix-CreateRelease
  • Loading branch information
mazhelez committed Jan 31, 2024
2 parents 34aa16b + 195b5f4 commit 0a57bad
Show file tree
Hide file tree
Showing 50 changed files with 162 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
Test:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run Tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CleanupTempRepos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
outputs:
githubOwner: ${{ steps.check.outputs.githubOwner }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check secrets
id: check
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: [ ubuntu-latest ]
needs: [ Check ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Remove Temp Repositories
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
}
}
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Deploy
env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/E2E.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
maxParallel: ${{ steps.check.outputs.maxParallel }}
githubOwner: ${{ steps.check.outputs.githubOwner }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check secrets
id: check
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
perTenantExtensionRepo: ${{ steps.setup.outputs.perTenantExtensionRepo }}
appSourceAppRepo: ${{ steps.setup.outputs.appSourceAppRepo }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

Expand All @@ -105,7 +105,7 @@ jobs:
releases: ${{ steps.Analyze.outputs.releases }}
scenarios: ${{ steps.Analyze.outputs.scenarios }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
if: github.event.inputs.runScenarios == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.scenarios) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
if: github.event.inputs.runTestMatrix == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.testruns) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
if: github.event.inputs.runUpgradeTests == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.releases) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
needs: [ Check, SetupRepositories, TestAlGo, TestAlGoUpgrade, Scenario ]
if: always() && (!Cancelled()) && (needs.SetupRepositories.result == 'Success') && (needs.TestAlGo.result == 'Success' || needs.TestAlGo.result == 'Skipped') && (needs.TestAlGoUpgrade.result == 'Success' || needs.TestAlGoUpgrade.result == 'Skipped') && (needs.Scenario.result == 'Success' || needs.Scenario.result == 'Skipped')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: .
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3

deploy:
environment:
Expand All @@ -44,6 +44,6 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
with:
preview: true
2 changes: 1 addition & 1 deletion .github/workflows/powershell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
Expand Down
2 changes: 1 addition & 1 deletion Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ function RetryCommand {
catch {
$retryCount++
if ($retryCount -eq $MaxRetries) {
throw $_
throw
}
else {
Write-Host "Retrying after $RetryDelaySeconds seconds..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
& /usr/bin/env sudo pwsh -command "& chmod +x $ENV:aldocPath"
}
Write-Host "Installing/Updating docfx"
CmdDo -command dotnet -arguments @("tool","update","-g docfx")
CmdDo -command dotnet -arguments @("tool","update","-g docfx") -messageIfCmdNotFound "dotnet not found. Please install it from https://dotnet.microsoft.com/download"
}
return $ENV:aldocPath
}
Expand Down
2 changes: 1 addition & 1 deletion Actions/DownloadProjectDependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
using: composite
steps:
- name: Download artifacts from current build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/.dependencies

Expand Down
27 changes: 21 additions & 6 deletions Actions/Github-Helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ function CmdDo {
[string] $arguments = "",
[switch] $silent,
[switch] $returnValue,
[string] $inputStr = ""
[string] $inputStr = "",
[string] $messageIfCmdNotFound = ""
)

$oldNoColor = "$env:NO_COLOR"
Expand Down Expand Up @@ -282,14 +283,27 @@ function CmdDo {
Write-Host $message
}
if ($returnValue) {
$message.Replace("`r","").Split("`n")
$message.Replace("`r", "").Split("`n")
}
}
else {
$message += "`n`nExitCode: "+$p.ExitCode + "`nCommandline: $command $arguments"
$message += "`n`nExitCode: " + $p.ExitCode + "`nCommandline: $command $arguments"
throw $message
}
}
catch [System.ComponentModel.Win32Exception] {
if ($_.Exception.NativeErrorCode -eq 2) {
if ($messageIfCmdNotFound) {
throw $messageIfCmdNotFound
}
else {
throw "Command $command not found, you might need to install that command."
}
}
else {
throw
}
}
finally {
try { [Console]::OutputEncoding = $oldEncoding } catch {}
$env:NO_COLOR = $oldNoColor
Expand Down Expand Up @@ -319,7 +333,7 @@ function invoke-gh {
$arguments += "$parameter "
}
}
cmdDo -command gh -arguments $arguments -silent:$silent -returnValue:$returnValue -inputStr $inputStr
cmdDo -command gh -arguments $arguments -silent:$silent -returnValue:$returnValue -inputStr $inputStr -messageIfCmdNotFound "Github CLI not found. Please install it from https://cli.github.com/"
}
}

Expand All @@ -343,7 +357,7 @@ function invoke-git {
$arguments += "$parameter "
}
}
cmdDo -command git -arguments $arguments -silent:$silent -returnValue:$returnValue -inputStr $inputStr
cmdDo -command git -arguments $arguments -silent:$silent -returnValue:$returnValue -inputStr $inputStr -messageIfCmdNotFound "Git not found. Please install it from https://git-scm.com/downloads"
}
}

Expand Down Expand Up @@ -538,7 +552,8 @@ function GetLatestRelease {
if ($isReleaseBranch) {
# If release branch, get the latest release from that the release branch
# This is given by the latest release with the same major.minor as the release branch
$semVerObj = SemVerStrToSemVerObj -semVerStr $ref.SubString($releaseBranchPrefix.Length) -allowMajorMinorOnly
$releaseVersion = $ref -split '/' | Select-Object -Last 1 # Get the version from the release branch
$semVerObj = SemVerStrToSemVerObj -semVerStr $releaseVersion -allowMajorMinorOnly
$latestRelease = $releases | Where-Object {
$releaseSemVerObj = SemVerStrToSemVerObj -semVerStr $_.tag_name
$semVerObj.Major -eq $releaseSemVerObj.Major -and $semVerObj.Minor -eq $releaseSemVerObj.Minor
Expand Down
11 changes: 8 additions & 3 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

Note that when using the preview version of AL-Go for GitHub, we recommend you Update your AL-Go system files, as soon as possible when informed that an update is available.

### New Settings
- `UpdateALGoSystemFilesEnvironment`: The name of the environment that is referenced in job `UpdateALGoSystemFiles` in the _Update AL-Go System Files_ workflow. See [jobs.<job_id>.environment](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idenvironment) for more information. Currently, only setting the environment name is supported.

### Issues
- Support release branches that start with releases/
- Issue 870 Improve Error Handling when CLI is missing

### Build modes
AL-Go ships with Default, Translated and Clean mode out of the box. Now you can also define custom build modes in addition to the ones shipped with AL-Go. This allows you to define your own build modes, which can be used to build your apps in different ways. By default, a custom build mode will build the apps similarly to the Default mode but this behavior can be overridden in e.g. script overrides in your repository.

## v4.1

### New Settings
- `templateSha`: The SHA of the version of AL-Go currently used
- `UpdateALGoSystemFilesEnvironment`: The name of the environment that is referenced in job `UpdateALGoSystemFiles` in the _Update AL-Go System Files_ workflow. See [jobs.<job_id>.environment](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idenvironment) for more information. Currently, only setting the environment name is supported.

### New Actions
- `DumpWorkflowInfo`: Dump information about running workflow
Expand All @@ -25,7 +31,6 @@ If false, the templateSha repository setting is used to download specific AL-Go
- App artifacts for version 'latest' are now fetched from the latest CICD run that completed and successfully built all the projects for the corresponding branch.
- Issue 824 Utilize `useCompilerFolder` setting when creating an development environment for an AL-Go project.
- Issue 828 and 825 display warnings for secrets, which might cause AL-Go for GitHub to malfunction
- Support release branches that start with releases/

### New Settings

Expand All @@ -40,7 +45,7 @@ If false, the templateSha repository setting is used to download specific AL-Go
- **footer** = Footer for the documentation site. (Default: Made with...)
- **defaultIndexMD** = Markdown for the landing page of the documentation site. (Default: Reference documentation...)
- **defaultReleaseMD** = Markdown for the landing page of the release sites. (Default: Release reference documentation...)
- *Note that in header, footer, defaultIndexMD and defaultReleaseMD you can use the following placeholders: {REPOSITORY}, {VERSION}, {INDEXTEMPLATERELATIVEPATH}, {RELEASENOTES}*
- *Note that in header, footer, defaultIndexMD and defaultReleaseMD you can use the following placeholders: {REPOSITORY}, {VERSION}, {INDEXTEMPLATERELATIVEPATH}, {RELEASENOTES}*

### New Workflows
- **Deploy Reference Documentation** is a workflow, which you can invoke manually or on a schedule to generate and deploy reference documentation using the aldoc tool, using the ALDoc setting properties described above.
Expand Down
2 changes: 1 addition & 1 deletion Scenarios/SelfHostedGitHubRunner.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GitHub runners can be registered for an organization (accessible for all reposit
## Allow your repository access to your runners
1. On the list of Runners on GitHub, choose the runner group **Default** and allow public repositories if your repository is public.
![public](https://github.com/microsoft/AL-Go/assets/10775043/9bdd01ab-ac67-44bf-bfd1-af5c5ec91364)
1. Now navigate to your project settings file (.AL-Go/settings.json) and set **gitHubRunner** to **self-hosted**.
1. Now navigate to your repo settings file (.github/AL-Go-Settings.json) and set **gitHubRunner** to **self-hosted**.
- Note that you can use other tags than **self-hosted** to identify special runners for GitHub jobs, or you can set gitHubRunner to "self-hosted, Windows" to ensure that a Windows version is selected if you have self-hosted linux runners as well.
1. Save and inspect your workflows performance increase on the second run.
1. Inspect that one of the runners pick up the workflow.
Expand Down
1 change: 1 addition & 0 deletions Scenarios/UpdateAlGoSystemFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
1. To update the AL-Go system files using the Update AL-Go System Files workflow, you need to provide a secret called GHTOKENWORKFLOW containing a Personal Access Token with permissions to modify workflows
1. In a browser, navigate to [New personal access token](https://github.com/settings/tokens/new) and create a new **personal access token**. Name it, set the expiration date and check the **workflow option** in the list of **scopes**.
![newPAT](https://github.com/microsoft/AL-Go/assets/10775043/1ab9978a-37e8-423a-8f8e-5c0203f7ae00)
1. Note that the above applies to **classic** tokens only. If you are creating a **Fine-grained** token, you need to specify which repositories to include and assign **Read and Write** permissions to **Contents**, **Pull Requests** and **Workflows**.
1. Generate the token and **copy it to the clipboard**. You won’t be able to see the token again.
1. On github.com, open **Settings** in your project and select **Secrets**. Choose the New repository secret button and create a secret called GHTOKENWORKFLOW and paste the personal access token in the value field and choose **Add secret**.
![PAT](https://github.com/microsoft/AL-Go/assets/10775043/7dcccca3-ec43-47ba-bffb-795332c890ad)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
shell: powershell

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize the workflow
id: init
Expand Down
24 changes: 12 additions & 12 deletions Templates/AppSource App/.github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
shell: powershell

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
lfs: true

Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
runs-on: [ windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Read settings
uses: microsoft/AL-Go-Actions/ReadSettings@main
Expand Down Expand Up @@ -172,10 +172,10 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: '.artifacts'

Expand All @@ -186,7 +186,7 @@ jobs:

- name: Setup Pages
if: needs.Initialization.outputs.deployALDocArtifact == 1
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4

- name: Build Reference Documentation
uses: microsoft/AL-Go-Actions/BuildReferenceDocumentation@main
Expand All @@ -195,14 +195,14 @@ jobs:
artifacts: '.artifacts'

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: ".aldoc/_site/"

- name: Deploy to GitHub Pages
if: needs.Initialization.outputs.deployALDocArtifact == 1
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4

Deploy:
needs: [ Initialization, Build ]
Expand All @@ -215,10 +215,10 @@ jobs:
url: ${{ steps.Deploy.outputs.environmentUrl }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: '.artifacts'

Expand Down Expand Up @@ -265,10 +265,10 @@ jobs:
name: Deliver to ${{ matrix.deliveryTarget }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: '.artifacts'

Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
runs-on: [ windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Finalize the workflow
id: PostProcess
Expand Down
2 changes: 1 addition & 1 deletion Templates/AppSource App/.github/workflows/CreateApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
shell: powershell

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize the workflow
id: init
Expand Down
Loading

0 comments on commit 0a57bad

Please sign in to comment.