|
1 | 1 | name: CI |
2 | 2 | on: [push, pull_request] |
3 | 3 | jobs: |
4 | | - ci: |
| 4 | + |
| 5 | + build-test: |
5 | 6 | strategy: |
6 | 7 | matrix: |
7 | 8 | platform: [x86, x64] |
@@ -60,47 +61,101 @@ jobs: |
60 | 61 | echo "$MAINTAINER_KEY" >~/.ssh/id_rsa |
61 | 62 | echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts |
62 | 63 | timeout-minutes: 1 |
63 | | - - name: Compute release name |
| 64 | + - name: Cygport stage |
64 | 65 | if: github.ref == 'refs/heads/main' |
| 66 | + run: SSH_KEY=~/.ssh/id_rsa cygport moreutils.cygport stage |
| 67 | + timeout-minutes: 5 |
| 68 | + - name: Tar up build results |
| 69 | + if: always() |
| 70 | + run: tar -caf moreutils-${{ matrix.platform }}.txz moreutils-*-*.*/ |
| 71 | + timeout-minutes: 10 |
| 72 | + - name: Store build results |
| 73 | + if: always() |
| 74 | + uses: actions/upload-artifact@v2 |
| 75 | + with: |
| 76 | + name: build-results-${{ matrix.platform }} |
| 77 | + path: moreutils-${{ matrix.platform }}.txz |
| 78 | + if-no-files-found: error |
| 79 | + timeout-minutes: 5 |
| 80 | + |
| 81 | + release: |
| 82 | + if: github.ref == 'refs/heads/main' |
| 83 | + needs: build-test |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Install lftp |
| 87 | + run: | |
| 88 | + sudo apt-get update |
| 89 | + sudo apt-get install lftp |
| 90 | + timeout-minutes: 5 |
| 91 | + - name: Checkout |
| 92 | + uses: actions/checkout@v2 |
| 93 | + with: |
| 94 | + fetch-depth: 0 |
| 95 | + timeout-minutes: 1 |
| 96 | + - name: Compute release name |
65 | 97 | id: release-name |
66 | 98 | run: | |
67 | 99 | eval $(grep -e '^VERSION=' -e '^RELEASE=' moreutils.cygport) |
68 | | - printf '::set-output name=release::v%s-%s' "$VERSION" "$RELEASE" |
| 100 | + printf '::set-output name=release::%s-%s' "$VERSION" "$RELEASE" |
| 101 | + timeout-minutes: 1 |
| 102 | + - name: Download build results |
| 103 | + uses: actions/download-artifact@v2 |
| 104 | + timeout-minutes: 5 |
| 105 | + - name: Unpack build results |
| 106 | + run: | |
| 107 | + tar -xaf build-results-x86/moreutils-x86.txz |
| 108 | + tar -xaf build-results-x64/moreutils-x64.txz |
| 109 | + timeout-minutes: 5 |
| 110 | + - name: Name release artifacts for the GitHub release |
| 111 | + env: |
| 112 | + PVR: ${{ steps.release-name.outputs.release }} |
| 113 | + run: | |
| 114 | + ( |
| 115 | + cd "moreutils-${PVR}.i686/dist/moreutils" && |
| 116 | + rm "moreutils-${PVR}-src".* && |
| 117 | + mv "moreutils-${PVR}.hint" "moreutils-${PVR}.i686.hint" && |
| 118 | + mv "moreutils-${PVR}.tar.xz" "moreutils-${PVR}.i686.tar.xz" |
| 119 | + ) |
| 120 | + ( |
| 121 | + cd "moreutils-${PVR}.x86_64/dist/moreutils" && |
| 122 | + mv "moreutils-${PVR}.hint" "moreutils-${PVR}.x86_64.hint" && |
| 123 | + mv "moreutils-${PVR}.tar.xz" "moreutils-${PVR}.x86_64.tar.xz" |
| 124 | + ) |
69 | 125 | timeout-minutes: 1 |
70 | 126 | - name: Create release tag |
71 | | - if: github.ref == 'refs/heads/main' |
72 | 127 | env: |
73 | 128 | GIT_COMMITTER_NAME: ${{ github.actor }} |
74 | 129 | GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com |
75 | 130 | run: | |
76 | | - git tag -am '${{ steps.release-name.outputs.release }}' '${{ steps.release-name.outputs.release }}' |
77 | | - git push origin tag '${{ steps.release-name.outputs.release }}' |
| 131 | + git tag -am 'v${{ steps.release-name.outputs.release }}' 'v${{ steps.release-name.outputs.release }}' |
| 132 | + git push origin tag 'v${{ steps.release-name.outputs.release }}' |
78 | 133 | timeout-minutes: 1 |
79 | 134 | - name: Create a GitHub release |
80 | | - if: github.ref == 'refs/heads/main' |
81 | 135 | uses: softprops/action-gh-release@v1 |
82 | 136 | with: |
83 | | - tag_name: ${{ steps.release-name.outputs.release }} |
| 137 | + tag_name: v${{ steps.release-name.outputs.release }}-test |
84 | 138 | files: moreutils-*/dist/moreutils/* |
85 | 139 | target_commitish: ${{ github.ref }} |
86 | 140 | timeout-minutes: 2 |
| 141 | + - name: Configure SSH |
| 142 | + env: |
| 143 | + MAINTAINER_KEY: ${{ secrets.MAINTAINER_KEY }} |
| 144 | + run: | |
| 145 | + umask 0077 |
| 146 | + mkdir -p ~/.ssh |
| 147 | + echo "$MAINTAINER_KEY" >~/.ssh/id_rsa |
| 148 | + echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts |
| 149 | + timeout-minutes: 1 |
87 | 150 | - name: Mirror to Cygwin Git repositories |
88 | | - if: github.ref == 'refs/heads/main' |
89 | | - run: git push cygwin@cygwin.com:/git/cygwin-packages/moreutils '${{ steps.release-name.outputs.release }}' |
| 151 | + run: git push cygwin@cygwin.com:/git/cygwin-packages/moreutils 'v${{ steps.release-name.outputs.release }}' |
90 | 152 | timeout-minutes: 5 |
91 | | - - name: Cygport upload |
92 | | - if: github.ref == 'refs/heads/main' |
93 | | - run: SSH_KEY=~/.ssh/id_rsa cygport moreutils.cygport upload |
94 | | - timeout-minutes: 5 |
95 | | - - name: Tar up build results |
96 | | - if: always() |
97 | | - run: tar -caf moreutils-${{ matrix.platform }}.txz moreutils-*-*.*/ |
98 | | - timeout-minutes: 10 |
99 | | - - name: Store build results |
100 | | - if: always() |
101 | | - uses: actions/upload-artifact@v2 |
102 | | - with: |
103 | | - name: build-results-${{ matrix.platform }} |
104 | | - path: moreutils-${{ matrix.platform }}.txz |
105 | | - if-no-files-found: error |
| 153 | + - name: Release on the Cygwin mirror |
| 154 | + run: > |
| 155 | + lftp -c 'set cmd:fail-exit on; |
| 156 | + set cmd:interactive on; |
| 157 | + set net:max-retries 1; |
| 158 | + open sftp://cygwin:@cygwin.com; |
| 159 | + put /dev/null -o /x86/release/moreutils/!ready; |
| 160 | + put /dev/null -o /x86_64/release/moreutils/!ready;' |
106 | 161 | timeout-minutes: 5 |
0 commit comments