Skip to content

Commit

Permalink
🚧Improve release workflow (#5)
Browse files Browse the repository at this point in the history
* Start work for issue #4

* ci: add ability to create github release and close milestone

* ci: fix issue with build status check

* force status check
  • Loading branch information
CalvinWilkinson authored Oct 9, 2023
1 parent 0755598 commit dc0ce44
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-status-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Run Build
run: |
deno run --allow-read --allow-run `
--no-remote
--no-remote `
--import-map=${{ github.workspace }}/vendor/import_map.json `
./.github/cicd/scripts/deno-check.ts;
40 changes: 29 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,33 @@ jobs:
- name: Run Tests
run: deno test

- name: Create Commit & Release Tag (${{ needs.get_version.outputs.version }})
- name: Creating ${{ inputs.release-type }} GitHub Release
uses: softprops/action-gh-release@v1
with:
name: "🚀${{ inputs.release-type }} Release - ${{ needs.get_version.outputs.version }}"
body_path: "${{ github.workspace }}/ReleaseNotes/${{ inputs.release-type }}Releases/Release-Notes-${{ needs.get_version.outputs.version }}.md"
files: "${{ github.workspace }}/ReleaseNotes/${{ inputs.release-type }}Releases/Release-Notes-${{ needs.get_version.outputs.version }}.md"
tag_name: "${{ needs.get_version.outputs.version }}"
prerelease: ${{ inputs.release-type == 'Preview' }}
draft: false

- name: Close Milestone
run: |
$tag = "${{ needs.get_version.outputs.version }}";
git config --global user.email "${{ vars.GIT_CONFIG_EMAIL }}";
git config --global user.name "Prod Release - (On behalf of Calvin Wilkinson)";
git commit --allow-empty -m "🚀${{ inputs.release-type }} Release";
git push;
git tag -a $tag -m "Production Release";
git push origin $tag;
$scriptUrl = "${{ vars.SCRIPT_BASE_URL }}/${{ vars.CICD_SCRIPTS_VERSION }}/${{ vars.SCRIPT_RELATIVE_DIR_PATH }}";
$scriptUrl = $scriptUrl.Replace("\", "/").Replace("//", "/");
$scriptUrl = $scriptUrl.EndsWith("/") ? $scriptUrl.Substring(0, $scriptUrl.Length - 1) : $scriptUrl;
$scriptUrl = "$scriptUrl/close-milestone.ts";
Write-Host "::notice::Close milestone script URL: $scriptUrl";
<# Deno Args:
1. Project name
2. Milestone name - This is the version
3. PAT
#>
deno run `
--allow-read --allow-net `
"$scriptUrl" `
"${{ vars.PROJECT_NAME }}" `
"${{ needs.get_version.outputs.version }}" `
"${{ secrets.CICD_TOKEN }}";

0 comments on commit dc0ce44

Please sign in to comment.