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

Revert 25 revert 24 users/ryanb58/GitHub actions fix deprecated feature #27

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
22 changes: 11 additions & 11 deletions .github/workflows/auto-export-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
name: Get current datetime
run: |
$datetime = $(Get-Date -Format "yyyy-MM-ddTHH:mm:ss")
echo "datetime=$datetime" >> "$GITHUB_OUTPUT"
echo "datetime=$datetime" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8

- name: Setup .NET Core environment
uses: actions/setup-dotnet@v1
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
$lines = $output -split "`n"
$versionLine = $lines | Where-Object { $_ -match "${{ github.event.inputs.solution_name }}" }
$version = ($versionLine -split "\s+")[3]
echo "current_version=$version" >> "$GITHUB_OUTPUT"
echo "current_version=$version" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
# Split the version into its components
$versionParts = $version.Split('.')
# Define an environment variable for the version part to increment
Expand All @@ -78,30 +78,30 @@ jobs:
}
# Reconstruct the version
$newVersion = "{0}.{1}.{2}.{3}" -f $versionParts[0], $versionParts[1], $versionParts[2], $versionParts[3]
echo "new_version=$newVersion" >> "$GITHUB_OUTPUT"
echo "new_version=$newVersion" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
$newVersionWithUnderscores = "{0}_{1}_{2}_{3}" -f $versionParts[0], $versionParts[1], $versionParts[2], $versionParts[3]
echo "new_version_with_underscores=$newVersionWithUnderscores" >> "$GITHUB_OUTPUT"
echo "new_version_with_underscores=$newVersionWithUnderscores" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8

- name: Increment the online version
run: pac solution online-version --solution-name "${{ github.event.inputs.solution_name }}" --solution-version ${{ steps.solution_versioning.outputs.new_version }}

- name: Export unmanaged solution
run: pac solution export --path "${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_unmanaged.zip" --name "${{ github.event.inputs.solution_name }}" --include general
run: pac solution export --path "${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_unmanaged.zip" --name "${{ github.event.inputs.solution_name }}" --include general

- name: Export managed solution
run: pac solution export --path "${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_managed.zip" --name "${{ github.event.inputs.solution_name }}" --managed --include general
run: pac solution export --path "${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_managed.zip" --name "${{ github.event.inputs.solution_name }}" --managed --include general

- name: Publish unmanaged artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_unmanaged
path: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_unmanaged.zip
name: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_unmanaged
path: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_unmanaged.zip

- name: Publish managed artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_managed
path: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_managed.zip
name: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_managed
path: ${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_managed.zip

- name: Auth with Source Environment
run: |
Expand All @@ -114,4 +114,4 @@ jobs:

- name: Deploy Managed version To Target Environment
run: |
pac solution import --path "${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputsnew_version_with_underscores }}_managed.zip" --activate-plugins --publish-changes
pac solution import --path "${{ github.event.inputs.solution_name }}_${{ steps.solution_versioning.outputs.new_version_with_underscores }}_managed.zip" --activate-plugins --publish-changes
13 changes: 9 additions & 4 deletions .github/workflows/export-to-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ on:
jobs:
export-solution:
runs-on: windows-latest

defaults:
run:
shell: pwsh

steps:
- id: date
name: Get current datetime
run: |
$datetime = $(Get-Date -Format "yyyy-MM-ddTHH:mm:ss")
echo "datetime=$datetime" >> "$GITHUB_OUTPUT"
$datetimeForBranchName = $datetime -replace ":", "-"
echo "datetime=$datetime" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
echo "datetimeForBranchName=$datetimeForBranchName" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8

- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -62,7 +67,7 @@ jobs:
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@github.com"
git checkout -b "${{ github.event.inputs.solution_name }}-${{ steps.date.outputs.datetime }}"
git checkout -b "${{ github.event.inputs.solution_name }}-${{ steps.date.outputs.datetimeForBranchName }}"
git add .
git commit -m "Synced ${{ github.event.inputs.solution_name }} Power Platform Solution"
git push --set-upstream origin "${{ github.event.inputs.solution_name }}-${{ steps.date.outputs.datetime }}"
git push --set-upstream origin "${{ github.event.inputs.solution_name }}-${{ steps.date.outputs.datetimeForBranchName }}"
Loading