Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release-linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
on:
release:
types: [published]
workflow_dispatch:

name: Build Release Binary (Linux ARM64)
jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
branches:
- master
workflow_dispatch:

name: Build and Test Release Binary (Linux)
jobs:
build:
Expand Down
56 changes: 32 additions & 24 deletions .github/workflows/release-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,70 @@ on:
pull_request:
branches:
- master
workflow_dispatch:

name: Build and Test Release Binary (macOS)

jobs:
build:
name: Build and Test Release Binary
runs-on: ${{ matrix.os }}
strategy:
matrix:
# https://github.com/actions/runner-images#available-images
os: [ macos-13, macos-13-xlarge ] # amd64, arm64
# macos-13 is x64 (Intel), macos-13-xlarge is arm64 (Apple Silicon)
os: [ macos-13, macos-13-xlarge ]
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build ${{ env.RUNNER_OS }} ${{ env.RUNNER_ARCH }} binary
- name: Build and Test ${{ matrix.os }} ${{ runner.arch }} binary
run: |
make
echo BUILD_FILE=git-crypt-${{ github.ref_name }}-darwin-${{ env.RUNNER_ARCH }} >> $GITHUB_ENV

- name: Run integration tests for ${{ env.BUILD_FILE }}
run: |
chmod +x ./tests/linux/basic-test.sh
./tests/linux/basic-test.sh

- name: Determine artifacts name
id: artifacts-name
env:
IS_RELEASE: ${{ github.event_name == 'release' }}
- name: Prepare Artifact
id: prep_artifact
run: |
if [ "$IS_RELEASE" = true ]; then
echo "artifacts-name=${{ env.BUILD_FILE }}" >> $GITHUB_ENV
else
echo "artifacts-name=${{ env.BUILD_FILE }}-dev" >> $GITHUB_ENV
# Use runner.arch which resolves to 'x64' or 'arm64'
FINAL_NAME="git-crypt-${{ github.ref_name }}-darwin-${{ runner.arch }}"

# Append '-dev' suffix for non-release builds (e.g., PRs)
if [[ "${{ github.event_name }}" != 'release' ]]; then
FINAL_NAME="${FINAL_NAME}-dev"
fi

echo "Renaming binary to ${FINAL_NAME}"
mv git-crypt "${FINAL_NAME}"

# Set the final name as an output for the next step
echo "artifact_name=${FINAL_NAME}" >> "$GITHUB_OUTPUT"

- name: Upload release artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifacts-name }}
path: git-crypt
# Use the output from the previous step for both the artifact and path
name: ${{ steps.prep_artifact.outputs.artifact_name }}
path: ${{ steps.prep_artifact.outputs.artifact_name }}

upload:
name: Upload Release Binary
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: build
permissions:
# 'contents: write' is required to upload assets to the release
contents: write
steps:
- name: Download release artifacts
- name: Download all release artifacts
uses: actions/download-artifact@v4

- name: Upload release assets
uses: AButler/upload-release-assets@v3
if: github.ref_type == 'tag'
- name: Upload assets to GitHub release
uses: AButler/upload-release-assets@v3.0
with:
files: git-crypt-*-darwin-*
repo-token: ${{ secrets.GITHUB_TOKEN }}
# The download action creates subdirectories for each artifact.
# The '**/...' glob pattern searches recursively to find the binaries.
files: '**/git-crypt-*-darwin-*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
branches:
- master
workflow_dispatch:

name: Build and Test Release Binary (Windows)
jobs:
build:
Expand Down
Loading