Use new artifact actions #1031
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
name: Continuous Integration | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
SYMBOL_PACKAGE: false | |
jobs: | |
build: | |
name: Build | |
env: | |
build-configuration: Release | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/sliekens/gw2sdk/devcontainer:latest | |
options: --user 1001 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # (no history limit) | |
filter: tree:0 | |
- name: Install dependencies | |
run: dotnet restore --locked-mode | |
- name: Test | |
run: dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore | |
env: | |
ApiKeyBasic: ${{ secrets.API_TOKEN_BASIC }} | |
ApiKey: ${{ secrets.API_TOKEN_FULL }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
- name: Build | |
run: dotnet build --configuration ${{ env.build-configuration }} --no-restore | |
- name: Pack artifacts | |
run: dotnet pack GW2SDK --configuration ${{ env.build-configuration }} --no-build --output artifacts | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: artifacts | |
deploy-to-github-packages: | |
name: Deploy to GitHub Packages | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-packages | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: artifacts | |
- name: Upload packages to GitHub Packages | |
run: dotnet nuget push artifacts/*.nupkg --source https://nuget.pkg.github.com/sliekens/index.json --api-key ${{secrets.GITHUB_TOKEN}} --skip-duplicate |