Modify build workflow to handle race variant packaging

Updated packaging step to include version suffix for race detector builds.
This commit is contained in:
Vorapol Rinsatitnon
2025-11-10 18:11:31 +07:00
committed by GitHub
parent f878d4504e
commit acbcea9b70

View File

@@ -26,6 +26,10 @@ jobs:
- linux_arm64
- linux_arm
- linux_386
variant: [standard]
include:
- target: windows_amd64
variant: race
steps:
- uses: actions/checkout@v4
@@ -40,6 +44,13 @@ jobs:
go-version-file: "go-legacy-win7/src/go.mod"
cache: false
- name: Revert race detector patches
if: matrix.variant == 'race'
run: |
cd go-legacy-win7
git apply -R patches/0008-Replace-atomic-Or-with-compare-and-swap-loop.patch
git apply -R patches/0007-Drop-public-And-Or-ops-and-race-instrumentation.patch
- name: Set execute permissions
run: |
chmod +x go-legacy-win7/src/make.bash
@@ -93,13 +104,22 @@ jobs:
cd tool
find . -mindepth 1 -maxdepth 1 -type d ! -name "${{ matrix.target }}" -exec rm -rf {} +
- name: Set version suffix
id: version
run: |
if [ "${{ matrix.variant }}" == "race" ]; then
echo "suffix=-race" >> $GITHUB_OUTPUT
else
echo "suffix=" >> $GITHUB_OUTPUT
fi
- name: Package
run: |
cd release
if [[ "${{ matrix.target }}" == windows_* ]]; then
zip -r ../go-legacy-win7-${{ inputs.version }}.${{ matrix.target }}.zip .
zip -r ../go-legacy-win7-${{ inputs.version }}${{ steps.version.outputs.suffix }}.${{ matrix.target }}.zip .
else
tar -czf ../go-legacy-win7-${{ inputs.version }}.${{ matrix.target }}.tar.gz .
tar -czf ../go-legacy-win7-${{ inputs.version }}${{ steps.version.outputs.suffix }}.${{ matrix.target }}.tar.gz .
fi
- name: Create Release
@@ -125,5 +145,5 @@ jobs:
--target main
gh release upload v${{ inputs.version }} \
../go-legacy-win7-${{ inputs.version }}.${{ matrix.target }}.* \
../go-legacy-win7-${{ inputs.version }}${{ steps.version.outputs.suffix }}.${{ matrix.target }}.* \
--clobber