Upload release assets with the built-in token instead of a personal o… #36
Workflow file for this run
This file contains hidden or 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
| name: Releases | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| jobs: | |
| githubrelease: | |
| runs-on: windows-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Verify commit exists in release branch | |
| run: | | |
| git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
| git branch --remote --contains | grep origin/${env:RELEASE_BRANCH} | |
| env: | |
| RELEASE_BRANCH: master | |
| - name: Restore dependencies | |
| run: dotnet restore Spritz/Spritz.sln | |
| - name: Build | |
| run: | | |
| $version= &git describe --tags | |
| dotnet build --no-restore --configuration Release /p:Version=${version} /p:Platform=x64 Spritz/Spritz.sln | |
| - name: Test | |
| run: | | |
| $version= &git describe --tags | |
| dotnet test --configuration Release /p:Platform=x64 /p:Version=${version} --no-build Spritz/Spritz.sln | |
| - name: Setup msbuild | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Build Installer | |
| run: | | |
| $version= &git describe --tags | |
| msbuild Spritz/SpritzInstaller/SpritzInstaller.wixproj /p:Configuration=Release /p:Version=${version} | |
| - name: Create archive | |
| uses: thedoctor0/zip-release@0.7.6 | |
| with: | |
| type: 'zip' | |
| filename: 'SpritzCMD.zip' | |
| path: Spritz/SpritzCMD/bin/x64/Release/net10.0/ | |
| directory: ./ | |
| - name: Upload SpritzCMD | |
| uses: svenstaro/upload-release-action@2.11.5 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: SpritzCMD.zip | |
| tag: ${{ github.ref }} | |
| - name: Upload Installer | |
| uses: svenstaro/upload-release-action@2.11.5 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: Spritz/SpritzInstaller/bin/Release/Spritz.msi | |
| tag: ${{ github.ref }} | |
| dockerrelease: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore Spritz/SpritzCMD/SpritzCMD.csproj | |
| # /p:Version matters here, not just in the githubrelease job: RunnerEngine.CurrentVersion is read | |
| # from the assembly, and it is written into the config the container consumes. Without this the | |
| # published image would report the development default while being tagged with the release version. | |
| - name: Build SpritzCMD | |
| run: | | |
| version=$(git describe --tags) | |
| dotnet build --no-restore --configuration Release /p:Version=${version} Spritz/SpritzCMD/SpritzCMD.csproj | |
| - name: Build docker image | |
| run: docker build -t spritz ./Spritz/ | |
| - name: Run quick test, reference database | |
| run: docker run --user=root spritz conda run --no-capture-output --live-stream dotnet SpritzCMD.dll -a=/app/spritz/results/ -r="release-96,saccharomyces_cerevisiae,baker's yeast,R64-1-1" | |
| - name: Login, tag, and push | |
| run: | | |
| echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | |
| version=$(git describe --tags) | |
| docker tag spritz ${{ secrets.DOCKERHUB_USERNAME }}/spritz:$version | |
| docker push ${{ secrets.DOCKERHUB_USERNAME }}/spritz:$version |