-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enable prereleases * pass is-prerelease * only release on main * from json
- Loading branch information
1 parent
700504d
commit 56628f4
Showing
3 changed files
with
46 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build & Test | ||
name: Build, Test, Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -68,16 +68,6 @@ jobs: | |
name: test-results | ||
path: ${{ env.ArtifactDirectory }}/**/*.trx | ||
|
||
# - name: Test Results Comment | ||
# if: always() | ||
# uses: im-open/[email protected] | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# timezone: ${{ env.TIMEZONE }} | ||
# create-status-check: false | ||
# create-pr-comment: true | ||
# comment-identifier: 'TestResults' | ||
|
||
# Cosmos DB Emulator is broken on Ubuntu | ||
# https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/56 | ||
|
||
|
@@ -141,16 +131,6 @@ jobs: | |
name: cosmos-test-results | ||
path: ${{ env.ArtifactDirectory }}/**/*.trx | ||
|
||
# - name: Test Results Comment | ||
# if: always() | ||
# uses: im-open/[email protected] | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# timezone: ${{ env.TIMEZONE }} | ||
# create-status-check: false | ||
# create-pr-comment: true | ||
# comment-identifier: 'CosmosTestResults' | ||
|
||
test_results_comment: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
|
@@ -180,13 +160,24 @@ jobs: | |
if: ${{ github.event_name != 'pull_request' }} | ||
uses: ./.github/workflows/tag.yml | ||
|
||
test-tag-output: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tag | ||
steps: | ||
- name: Echo tag output | ||
run: | | ||
echo prerelease-depth: "${{ fromJSON(needs.tag.outputs.prerelease-depth) }}" | ||
echo is-prerelease: "${{ fromJSON(needs.tag.outputs.is-prerelease) }}" | ||
release: | ||
needs: | ||
- tag | ||
- build_and_test | ||
- build_and_test_cosmos | ||
if: ${{ github.event_name != 'pull_request' && needs.tag.outputs.prerelease-depth < 2 }} | ||
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && fromJSON(needs.tag.outputs.prerelease-depth) < 2 }} | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
version: ${{ needs.tag.outputs.version }} | ||
is-prerelease: ${{ needs.tag.outputs.is-prerelease }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,9 @@ on: | |
prerelease-depth: | ||
description: "Number of periods in the prerelease version" | ||
value: ${{ jobs.tag.outputs.prerelease-depth }} | ||
is-prerelease: | ||
description: "Boolean string indicating whether the version is a prerelease" | ||
value: ${{ jobs.tag.outputs.is-prerelease }} | ||
|
||
env: | ||
#MinVerIgnoreHeight: true | ||
|
@@ -36,7 +39,8 @@ jobs: | |
minor: ${{ steps.version.outputs.minor }} | ||
patch: ${{ steps.version.outputs.patch }} | ||
prerelease: ${{ steps.version.outputs.prerelease }} | ||
prerelease-depth: ${{ steps.get-prerelease-depth.outputs.prerelease_depth }} | ||
prerelease-depth: ${{ steps.set-prerelease-depth.outputs.prerelease_depth }} | ||
is-prerelease: ${{ steps.set-is-prerelease.outputs.is_prerelease }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
|
@@ -51,36 +55,48 @@ jobs: | |
tag-prefix: v | ||
default-pre-release-phase: preview | ||
|
||
- name: echo version #version major minor patch prerelease | ||
- name: Echo version #version major minor patch prerelease | ||
run: | | ||
echo Version: ${{ steps.version.outputs.version }} | ||
echo version: ${{ steps.version.outputs.version }} | ||
echo major: ${{ steps.version.outputs.major }}, minor: ${{ steps.version.outputs.minor }}, patch: ${{ steps.version.outputs.patch }} | ||
echo prerelease: ${{ steps.version.outputs.prerelease }} | ||
- name: get prerelease depth | ||
id: get-prerelease-depth | ||
- name: Set prerelease depth | ||
id: set-prerelease-depth | ||
run: | | ||
echo "prerelease_depth=$(echo '${{ steps.version.outputs.prerelease }}' | tr -cd '.' | wc -c | tr -d ' ')" >> "$GITHUB_OUTPUT" | ||
- run: echo "${{ steps.get-prerelease-depth.outputs.prerelease_depth }}" | ||
- name: Echo prerelease depth | ||
run: echo "${{ steps.set-prerelease-depth.outputs.prerelease_depth }}" | ||
|
||
- name: Set is-prerelease | ||
id: set-is-prerelease | ||
run: | | ||
echo "is_prerelease=$(echo '${{ contains(steps.version.outputs.version, '-') && 'true' || 'false' }}')" >> "$GITHUB_OUTPUT" | ||
- name: Echo is-prerelease | ||
run: echo "${{ steps.set-is-prerelease.outputs.is_prerelease }}" | ||
|
||
# - run: | | ||
# git tag v${{ steps.version.outputs.version }} | ||
# git push --tags | ||
- name: Tag version | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
git tag v${{ steps.version.outputs.version }} | ||
git push --tags | ||
# Update unstable tag on main branch | ||
- name: unstable tag | ||
- name: Tag unstable | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: EndBug/[email protected] | ||
with: | ||
ref: unstable | ||
|
||
# Update latest tag on main branch when tagged RTM | ||
- name: latest tag | ||
- name: Tag latest | ||
if: ${{ github.ref == 'refs/heads/main' && steps.version.outputs.prerelease == '' }} | ||
uses: EndBug/[email protected] | ||
|
||
# - name: Version tag | ||
# - name: Tag version | ||
# if: ${{ github.ref == 'refs/heads/main' }} | ||
# uses: EndBug/[email protected] | ||
# with: | ||
# ref: v${{ steps.version.outputs.version }} |