Skip to content

Workflow file for this run

on:
release:
types: [published]
pull_request:
branches:
- master
name: Build and Test Release Binary (Windows)
jobs:
build:
name: Build and Test Release Binary
runs-on: windows-2022
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
base-devel
msys2-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-openssl
openssl-devel
- name: Build binary
shell: msys2 {0}
run: |
make clean
make ENABLE_MAN=no
- name: Run integration tests
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
./tests/windows/basic-test.ps1
- name: Artifacts name
id: artifacts-name
env:
IS_RELEASE: ${{ github.event_name == 'release' }}
run: |
$artifactsName = if ($env:IS_RELEASE -eq "true") {
"git-crypt-artifacts"
} else {
"git-crypt-artifacts-dev"
}
"artifacts-name=$artifactsName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifacts-name }}
path: git-crypt.exe
upload:
name: Upload Release Binary
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: build
permissions:
contents: write
steps:
- name: Download release artifact
uses: actions/download-artifact@v4
with:
name: git-crypt-artifacts
- name: Upload release asset
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require("fs").promises;
const { owner, repo } = context.repo;
await github.rest.repos.uploadReleaseAsset({
owner,
repo,
release_id: context.payload.release.id,
name: `git-crypt-${context.payload.release.tag_name}-x86_64.exe`,
data: await fs.readFile('git-crypt.exe'),
});
core.notice(`✅ Uploaded release asset: git-crypt-${context.payload.release.tag_name}-x86_64.exe`);