Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This fix should allow setting safe.directory manually and not having it
overridden by the actions/checkout action.  Test the behaviour works as
expected for both the Cygwin runner (with a manually set safe.directory
in the Git config file) and the Ubuntu runner (with no explicit
safe.directory wrangling).

Disable build steps that are unnecessary / slow / would produce
permanent changes.  Enable steps that we want to check with this action
even though they'd normally only be run for actual releases (subject to
the previous caveat).
  • Loading branch information
me-and committed Apr 20, 2022
1 parent 00c7162 commit 5d8041f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Expand Up @@ -12,7 +12,6 @@ jobs:
shell: bash --noprofile --norc -e -o pipefail -o igncr {0}
env:
PATH: C:\cygwin\bin
HOME: C:\cygwin\home\runneradmin
steps:
- name: Install Cygwin Git
uses: cygwin/cygwin-install-action@v2
Expand All @@ -24,7 +23,9 @@ jobs:
run: git config --global --add safe.directory '*'
timeout-minutes: 1
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@users/tihuang/setsafedirinput
with:
set-safe-directory: false
timeout-minutes: 1
- name: Load packages to install
id: cyg-package-list
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
run: cygport git.cygport compile
timeout-minutes: 30
- name: Cygport test
if: false
run: cygport git.cygport test
timeout-minutes: 300
- name: Cygport install
Expand All @@ -68,7 +70,7 @@ jobs:
run: cygport git.cygport package
timeout-minutes: 5
- name: Configure SSH
if: github.ref == 'refs/heads/main'
if: false
env:
MAINTAINER_KEY: ${{ secrets.MAINTAINER_KEY }}
run: |
Expand All @@ -78,7 +80,7 @@ jobs:
echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts
timeout-minutes: 1
- name: Cygport stage
if: github.ref == 'refs/heads/main'
if: false
run: SSH_KEY=~/.ssh/id_rsa cygport git.cygport stage
timeout-minutes: 5
- name: Tar up build results
Expand All @@ -95,7 +97,6 @@ jobs:
timeout-minutes: 5

release:
if: github.ref == 'refs/heads/main'
needs: build-test
runs-on: ubuntu-latest
permissions:
Expand All @@ -106,11 +107,8 @@ jobs:
sudo apt-get update
sudo apt-get install lftp
timeout-minutes: 5
- name: Configure safe.directory # Workaround for actions/checkout#760
run: git config --global --add safe.directory '*'
timeout-minutes: 1
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@users/tihuang/setsafedirinput
with:
fetch-depth: 0
timeout-minutes: 1
Expand Down Expand Up @@ -152,7 +150,7 @@ jobs:
GIT_COMMITTER_NAME: ${{ github.actor }}
GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
run: |
git tag -am 'v${{ steps.release-name.outputs.release }}' 'v${{ steps.release-name.outputs.release }}'
git tag -am 'v${{ steps.release-name.outputs.release }}' 'v${{ steps.release-name.outputs.release }}-test'
git push origin tag 'v${{ steps.release-name.outputs.release }}'
timeout-minutes: 1
- name: Create a GitHub release
Expand All @@ -163,6 +161,7 @@ jobs:
git-*/dist/git/*
git-*/dist/git/*/*
target_commitish: ${{ github.ref }}
draft: true
timeout-minutes: 2
- name: Configure SSH
env:
Expand All @@ -174,6 +173,7 @@ jobs:
echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts
timeout-minutes: 1
- name: Mirror to Cygwin Git repositories
if: false
run: git push cygwin@cygwin.com:/git/cygwin-packages/git 'v${{ steps.release-name.outputs.release }}'
timeout-minutes: 5
- name: Release on the Cygwin mirror
Expand All @@ -182,6 +182,5 @@ jobs:
set cmd:interactive on;
set net:max-retries 1;
open sftp://cygwin:@cygwin.com;
put /dev/null -o /x86/release/git/!ready;
put /dev/null -o /x86_64/release/git/!ready;'
ls;'
timeout-minutes: 5

0 comments on commit 5d8041f

Please sign in to comment.