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

AppVeyor deployment enhancements #2185

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ init:
- ps: |
$version = new-object System.Version $env:APPVEYOR_BUILD_VERSION
$env:flowVersion = "{0}.{1}.{2}" -f $version.Major, $version.Minor, $version.Build
if ($env:APPVEYOR_REPO_BRANCH -eq "dev")
{
$env:prereleaseTag = "{0}.{1}.{2}.{3}" -f $version.Major, $version.Minor, $version.Build, $version.Revision
}
Comment on lines -7 to -10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed? We need to add the revision version for prereleases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not removed, just replaced with $APPVEYOR_BUILD_VERSION, they are exactly the same

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine make sure you test it, if I remember correctly when I updated this, that pipeline variable returned only the build number part of the version.

Copy link
Member

@jjw24 jjw24 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we want revision number too not just the build number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see line 5 above, $env:prereleaseTag was derived from $env:APPVEYOR_BUILD_VERSION

- sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest
- net start WSearch

Expand Down Expand Up @@ -57,7 +53,7 @@ deploy:

- provider: GitHub
repository: Flow-Launcher/Prereleases
release: v$(prereleaseTag)
release: v$(APPVEYOR_BUILD_VERSION)
description: 'This is the early access build of our upcoming release. All changes contained here are reviewed, tested and stable to use.\n\nSee our [release](https://github.com/Flow-Launcher/Flow.Launcher/pulls?q=is%3Aopen+is%3Apr+label%3Arelease) Pull Request for details.\n\nFor latest production release visit [here](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest)\n\nPlease report any bugs or issues over at the [main repository](https://github.com/Flow-Launcher/Flow.Launcher/issues)'
auth_token:
secure: ij4UeXUYQBDJxn2YRAAhUOjklOGVKDB87Hn5J8tKIzj13yatoI7sLM666QDQFEgv
Expand All @@ -67,20 +63,23 @@ deploy:
branch: dev

- provider: GitHub
repository: Flow-Launcher/Prereleases
release: v$(flowVersion)
description: 'This is a release candidate of v$(flowVersion)'
auth_token:
secure: ij4UeXUYQBDJxn2YRAAhUOjklOGVKDB87Hn5J8tKIzj13yatoI7sLM666QDQFEgv
artifact: Squirrel Installer, Portable Version, Squirrel nupkg, Squirrel RELEASES
draft: true
force_update: true
on:
branch: master
APPVEYOR_REPO_TAG: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? Does this mean trigger on master or non-tagged builds?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I want is for it to trigger on master & tag, but I need to test to make sure that's how it behaves

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaking, I think you are trying to cover a scenario (doing a hot fix during a release) that has never happened. We have had several times where we needed to immediately rollout a hot fix after a release, but never during.

Assuming a tag is only created after setting the draft release to latest, you can just cater for:

  1. Merge to master -> draft release, so 'on master' condition
  2. Setting draft release to latest -> trigger 'on tag' -> publish NuGet and Prerelease

I think this is a simpler pipeline process. Any hot fixes we just do a new release. If we need to really hot fix during a release, I can just delete draft release, then merge hot fix in, which will kick off the above process again.

You will find testing this is a painful process because our build & test takes a while, recommend fork the project and the prerelease project, comment out the unit test code and test that way. Also I might be wrong but off the top of my head I think the 'on' condition you got is 'master' or 'tag is false'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaking, I think you are trying to cover a scenario (doing a hot fix during a release) that has never happened. We have had several times where we needed to immediately rollout a hot fix after a release, but never during.

I am not trying to cover that scenario, really... it just happens to be possible with this setup, so I'm spelling it out.

Assuming a tag is only created after setting the draft release to latest, you can just cater for:

  1. Merge to master -> draft release, so 'on master' condition

  2. Setting draft release to latest -> trigger 'on tag' -> publish NuGet and Prerelease

so you suggest that we push to Prereleases when APPVEYOR_REPO_TAG: true right?

Also I might be wrong but off the top of my head I think the 'on' condition you got is 'master' or 'tag is false'.

yeah it could be so, I'll define a different env variable for this to be sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you suggest that we push to Prereleases when APPVEYOR_REPO_TAG: true right?

Yeah. I don't think it matters if it's pushed on merge to master or when APPVEYOR_REPO_TAG: true. If on merge to master you can set force push to true so hot fix during a release will still update the prerelease artefacts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release artifacts wont be exactly the same but that's no big deal


- provider: GitHub
release: v$(flowVersion)
auth_token:
secure: ij4UeXUYQBDJxn2YRAAhUOjklOGVKDB87Hn5J8tKIzj13yatoI7sLM666QDQFEgv
artifact: Squirrel Installer, Portable Version, Squirrel nupkg, Squirrel RELEASES
force_update: true
jjw24 marked this conversation as resolved.
Show resolved Hide resolved
draft: true
on:
APPVEYOR_REPO_TAG: true
branch: master
APPVEYOR_REPO_TAG: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above comment