diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 336e731..2d1df31 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: 'Version to release (e.g., 0.1.0)' + description: 'Version to release (e.g., 1.0.0)' required: true type: string @@ -16,12 +16,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: '20' + node-version: '24' cache: 'npm' - name: Install dependencies @@ -46,13 +46,13 @@ jobs: git tag -f v${{ inputs.version }} git push origin v${{ inputs.version }} --force - # Also update major version tag (e.g., v0 for v0.1.0) + # Also update major version tag (e.g., v1 for v1.0.0) MAJOR=$(echo "${{ inputs.version }}" | cut -d. -f1) git tag -f v${MAJOR} git push origin v${MAJOR} --force - name: Create GitHub Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: tag_name: v${{ inputs.version }} name: v${{ inputs.version }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23df72a..4d8723a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,35 +9,47 @@ on: jobs: test: runs-on: windows-latest - + strategy: + matrix: + version: [ '1.3.0', 'latest' ] + steps: - name: Checkout - uses: actions/checkout@v4 - + uses: actions/checkout@v6 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: '20' - + node-version: '24' + - name: Install dependencies - run: npm install - - - name: Build action - run: npm run package - + run: npm ci + + - name: Check TypeScript + run: npm run build + - name: Setup covdbg + id: setup-covdbg uses: ./ with: - version: '1.0.0-beta.1+242' - - - name: Verify covdbg is in PATH + version: ${{ matrix.version }} + + - name: Verify covdbg installation + shell: pwsh + env: + EXPECTED_VERSION: ${{ matrix.version }} + COVDBG_PATH: ${{ steps.setup-covdbg.outputs.covdbg-path }} run: | - Write-Host "Checking if covdbg is available..." - Get-Command covdbg -ErrorAction SilentlyContinue - if ($?) { - Write-Host "✓ covdbg is in PATH" - } else { - Write-Host "✗ covdbg is not in PATH" - exit 1 + $command = Get-Command covdbg -ErrorAction Stop + if ($command.Source -ne (Join-Path $env:COVDBG_PATH 'covdbg.exe')) { + throw 'covdbg does not resolve to the action output directory.' + } + if (-not (Test-Path (Join-Path $env:COVDBG_PATH 'libcovdbg.dll'))) { + throw 'libcovdbg.dll is missing from the installation.' + } + $version = covdbg --version + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + Write-Host $version + if ($env:EXPECTED_VERSION -ne 'latest' -and $version -ne "covdbg $env:EXPECTED_VERSION") { + throw "Expected covdbg $env:EXPECTED_VERSION, got $version." } - shell: pwsh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 03956ea..d86ef26 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,6 +52,16 @@ Test your changes locally using the test workflow: 3. Update the README.md with details of changes if applicable 4. Your PR will be reviewed by maintainers +## Releasing + +After the changes are merged into `main`, run the **Release** workflow on `main` with version `1.0.0`: + +```bash +gh workflow run release.yml --ref main -f version=1.0.0 +``` + +The workflow rebuilds the action, publishes the `v1.0.0` release, and updates the `v1` tag used by `liasoft/setup-covdbg@v1`. Changing `package.json` alone does not create these Git tags. The action version is independent of the covdbg version selected through the `version` input. + ## Questions? Open an issue for discussion or clarification. diff --git a/README.md b/README.md index 7cc83f2..432a176 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ Add this action to your workflow: ```yaml steps: - name: Setup covdbg - uses: covdbg/setup-covdbg@v1 + uses: liasoft/setup-covdbg@v1 with: - version: '1.0.0' + version: '1.3.0' - name: Run covdbg run: covdbg --version @@ -33,12 +33,12 @@ steps: ### `version` (required) -The version of covdbg to download and setup. This should be a semantic version string (e.g., `1.0.0`, `2.1.3`). +The version of covdbg to download and setup. Use `1.3.0` for the stable release or `latest` to follow the latest published release. Pin a version for reproducible workflows. **Example:** ```yaml with: - version: '1.0.0' + version: '1.3.0' ``` ## Outputs @@ -51,9 +51,9 @@ The path where covdbg was installed and cached. ```yaml - name: Setup covdbg id: setup-covdbg - uses: covdbg/setup-covdbg@v1 + uses: liasoft/setup-covdbg@v1 with: - version: '1.0.0' + version: '1.3.0' - name: Display installation path run: echo "Covdbg installed at ${{ steps.setup-covdbg.outputs.covdbg-path }}" @@ -76,19 +76,32 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup covdbg - uses: covdbg/setup-covdbg@v1 + uses: liasoft/setup-covdbg@v1 with: - version: '1.0.0' + version: '1.3.0' - name: Verify covdbg installation run: | covdbg --version - covdbg --help ``` +## Collecting coverage + +Public repositories are free, but CI still authenticates with a project token. Installing covdbg does not sign in to the license service. To collect coverage in CI, add a `COVDBG_PROJECT_TOKEN` Actions secret containing a covdbg project token authorized for your repository, then pass it to the coverage step: + +```yaml +- name: Collect coverage + shell: pwsh + env: + COVDBG_PROJECT_TOKEN: ${{ secrets.COVDBG_PROJECT_TOKEN }} + run: covdbg --config .covdbg.yaml --output coverage.covdb .\build\Debug\test_app.exe +``` + +See [liasoft/covdbg-quick-start](https://github.com/liasoft/covdbg-quick-start) for a complete C++ example. For local use, sign in with `covdbg login`. + ## How It Works This action uses the GitHub Actions Toolkit, specifically: @@ -96,7 +109,7 @@ This action uses the GitHub Actions Toolkit, specifically: - **@actions/tool-cache**: For downloading, extracting, and caching the covdbg binary The action performs the following steps: -1. Reads the `version` input parameter (or uses 'latest') +1. Reads the `version` input parameter (required; use an explicit version or `latest`) 2. Constructs the download URL for the specified version from covdbg.com 3. Downloads the covdbg.zip archive containing covdbg.exe and libcovdbg.dll 4. Extracts the archive @@ -106,8 +119,8 @@ The action performs the following steps: ## Requirements -- Runs on Windows runners (windows-latest, windows-2022, windows-2019) -- Requires Node.js 20 runtime (automatically available on GitHub-hosted runners) +- Runs on Windows runners (windows-latest or windows-2022) +- Requires the Node.js 24 action runtime and Actions Runner 2.327.1 or newer (automatically available on GitHub-hosted runners) ## Development @@ -115,7 +128,7 @@ To build and package the action: ```bash # Install dependencies -npm install +npm ci # Build TypeScript npm run build @@ -124,7 +137,8 @@ npm run build npm run package ``` -**Note**: The `dist/` directory is not tracked in git. You must build the action locally before testing or using it. +> [!NOTE] +> The `dist/` directory is tracked in Git and is what GitHub Actions executes. Commit regenerated `dist/` files whenever the action source changes. ## License diff --git a/action.yml b/action.yml index e164f0a..433961e 100644 --- a/action.yml +++ b/action.yml @@ -6,11 +6,11 @@ branding: color: 'blue' inputs: version: - description: 'Version of covdbg to download (e.g., 1.0.0, latest)' + description: 'Version of covdbg to download (e.g., 1.3.0, latest)' required: true outputs: covdbg-path: description: 'Path where covdbg was installed' runs: - using: 'node20' + using: 'node24' main: 'dist/index.js' diff --git a/package-lock.json b/package-lock.json index c1ae043..998c193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "setup-covdbg", - "version": "0.1.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "setup-covdbg", - "version": "0.1.0", + "version": "1.0.0", "license": "MIT", "dependencies": { "@actions/core": "^1.10.1", diff --git a/package.json b/package.json index 748c53d..4fa1d4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-covdbg", - "version": "0.1.0", + "version": "1.0.0", "description": "GitHub Action to download and setup covdbg on Windows runners", "main": "dist/index.js", "scripts": { @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/covdbg/setup-covdbg.git" + "url": "git+https://github.com/liasoft/setup-covdbg.git" }, "keywords": [ "actions",