|
13 | 13 | name: release
|
14 | 14 | on:
|
15 | 15 | push:
|
16 |
| -# # Enable when testing release infrastructure on a branch. |
17 |
| -# branches: |
18 |
| -# - main |
| 16 | + # Enable when testing release infrastructure on a branch. |
| 17 | + branches: |
| 18 | + - dev |
19 | 19 | tags:
|
20 | 20 | - 'v[0-9]+.[0-9]+.[0-9]+'
|
21 | 21 | jobs:
|
22 | 22 | create-release:
|
23 | 23 | name: create-release
|
24 | 24 | runs-on: ubuntu-latest
|
25 |
| -# env: |
26 |
| -# # Set to force version number, e.g., when no tag exists. |
27 |
| -# ARTIFACT_VERSION: TEST-0.0.1 |
| 25 | + env: |
| 26 | + # Set to force version number, e.g., when no tag exists. |
| 27 | + ARTIFACT_VERSION: TEST-0.0.1 |
28 | 28 | steps:
|
29 | 29 | - name: Create artifacts directory
|
30 | 30 | run: mkdir artifacts
|
@@ -59,136 +59,137 @@ jobs:
|
59 | 59 | name: artifacts
|
60 | 60 | path: artifacts
|
61 | 61 |
|
62 |
| - release-unix: |
63 |
| - name: release |
64 |
| - needs: ['create-release'] |
65 |
| - runs-on: ${{ matrix.os }} |
66 |
| - env: |
67 |
| - # For some builds, we use cross to test on 32-bit and big-endian |
68 |
| - # systems. |
69 |
| - CARGO: cargo |
70 |
| - # When CARGO is set to CROSS, this is set to `--target matrix.target`. |
71 |
| - TARGET_FLAGS: |
72 |
| - # When CARGO is set to CROSS, TARGET_DIR includes matrix.target. |
73 |
| - TARGET_DIR: ./target |
74 |
| - # Emit backtraces on panics. |
75 |
| - RUST_BACKTRACE: 1 |
76 |
| - BIN_NAME: gix |
77 |
| - strategy: |
78 |
| - matrix: |
79 |
| - build: [linux, linux-arm, macos] |
80 |
| - feature: ["small", "lean-termion", "max-termion"] |
81 |
| - include: |
82 |
| - - build: linux |
83 |
| - os: ubuntu-18.04 |
84 |
| - rust: nightly |
85 |
| - target: x86_64-unknown-linux-musl |
86 |
| - - build: macos |
87 |
| - os: macos-latest |
88 |
| - rust: nightly |
89 |
| - target: x86_64-apple-darwin |
90 |
| - - build: linux-arm |
91 |
| - os: ubuntu-18.04 |
92 |
| - rust: nightly |
93 |
| - target: arm-unknown-linux-gnueabihf |
94 |
| - |
95 |
| - |
96 |
| - steps: |
97 |
| - - name: Checkout repository |
98 |
| - uses: actions/checkout@v1 |
99 |
| - with: |
100 |
| - fetch-depth: 1 |
101 |
| - |
102 |
| - - name: Install packages (Ubuntu) |
103 |
| - if: matrix.os == 'ubuntu-18.04' |
104 |
| - run: | |
105 |
| - ci/ubuntu-install-packages |
106 |
| -
|
107 |
| - - name: Install packages (macOS) |
108 |
| - if: matrix.os == 'macos-latest' |
109 |
| - run: | |
110 |
| - ci/macos-install-packages |
111 |
| -
|
112 |
| - - name: Install Rust |
113 |
| - uses: actions-rs/toolchain@v1 |
114 |
| - with: |
115 |
| - toolchain: ${{ matrix.rust }} |
116 |
| - profile: minimal |
117 |
| - override: true |
118 |
| - target: ${{ matrix.target }} |
119 |
| - |
120 |
| - - name: Use Cross |
121 |
| - run: | |
122 |
| - cargo install --git https://github.com/rust-embedded/cross |
123 |
| - echo "::set-env name=CARGO::cross" |
124 |
| - echo "::set-env name=TARGET_FLAGS::--target ${{ matrix.target }}" |
125 |
| - echo "::set-env name=TARGET_DIR::./target/${{ matrix.target }}" |
126 |
| -
|
127 |
| - - name: Show command used for Cargo |
128 |
| - run: | |
129 |
| - echo "cargo command is: ${{ env.CARGO }}" |
130 |
| - echo "target flag is: ${{ env.TARGET_FLAGS }}" |
131 |
| - echo "target dir is: ${{ env.TARGET_DIR }}" |
132 |
| -
|
133 |
| - - name: Get release download URL |
134 |
| - uses: actions/download-artifact@v1 |
135 |
| - with: |
136 |
| - name: artifacts |
137 |
| - path: artifacts |
138 |
| - |
139 |
| - - name: Set release upload URL and release version |
140 |
| - shell: bash |
141 |
| - run: | |
142 |
| - release_upload_url="$(cat artifacts/release-upload-url)" |
143 |
| - echo "::set-env name=RELEASE_UPLOAD_URL::$release_upload_url" |
144 |
| - echo "release upload url: $RELEASE_UPLOAD_URL" |
145 |
| - release_version="$(cat artifacts/release-version)" |
146 |
| - echo "::set-env name=RELEASE_VERSION::$release_version" |
147 |
| - echo "release version: $RELEASE_VERSION" |
148 |
| -
|
149 |
| - - name: Build release binary |
150 |
| - run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} --no-default-features --features ${{ matrix.feature }} |
151 |
| - |
152 |
| - - name: Strip release binary (linux and macos) |
153 |
| - if: matrix.build == 'linux' || matrix.build == 'macos' |
154 |
| - shell: bash |
155 |
| - run: strip target/${{ matrix.target }}/release/${{ env.BIN_NAME }}{,p} |
156 |
| - |
157 |
| - - name: Strip release binary (arm) |
158 |
| - if: matrix.build == 'linux-arm' |
159 |
| - run: | |
160 |
| - docker run --rm -v \ |
161 |
| - "$PWD/target:/target:Z" \ |
162 |
| - rustembedded/cross:arm-unknown-linux-gnueabihf \ |
163 |
| - arm-linux-gnueabihf-strip \ |
164 |
| - /target/arm-unknown-linux-gnueabihf/release/${{ env.BIN_NAME }}{,p} |
165 |
| -
|
166 |
| - - name: Build archive |
167 |
| - shell: bash |
168 |
| - run: | |
169 |
| - staging="${{ env.BIN_NAME }}-${{ matrix.feature }}-${{ env.RELEASE_VERSION }}-${{ matrix.target }}" |
170 |
| - mkdir -p "$staging" |
171 |
| -
|
172 |
| - cp {README.md,LICENSE-*,CHANGELOG.md} "$staging/" |
173 |
| -
|
174 |
| - cp target/${{ matrix.target }}/release/${{ env.BIN_NAME }}{,p} "$staging/" |
175 |
| - tar czf "$staging.tar.gz" "$staging" |
176 |
| - echo "::set-env name=ASSET::$staging.tar.gz" |
177 |
| -
|
178 |
| - - name: Upload release archive |
179 |
| - |
180 |
| - env: |
181 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
182 |
| - with: |
183 |
| - upload_url: ${{ env.RELEASE_UPLOAD_URL }} |
184 |
| - asset_path: ${{ env.ASSET }} |
185 |
| - asset_name: ${{ env.ASSET }} |
186 |
| - asset_content_type: application/octet-stream |
187 |
| - |
| 62 | +# release-unix: |
| 63 | +# name: release |
| 64 | +# needs: ['create-release'] |
| 65 | +# runs-on: ${{ matrix.os }} |
| 66 | +# env: |
| 67 | +# # For some builds, we use cross to test on 32-bit and big-endian |
| 68 | +# # systems. |
| 69 | +# CARGO: cargo |
| 70 | +# # When CARGO is set to CROSS, this is set to `--target matrix.target`. |
| 71 | +# TARGET_FLAGS: |
| 72 | +# # When CARGO is set to CROSS, TARGET_DIR includes matrix.target. |
| 73 | +# TARGET_DIR: ./target |
| 74 | +# # Emit backtraces on panics. |
| 75 | +# RUST_BACKTRACE: 1 |
| 76 | +# BIN_NAME: gix |
| 77 | +# strategy: |
| 78 | +# matrix: |
| 79 | +# build: [linux, linux-arm, macos] |
| 80 | +# feature: ["small", "lean-termion", "max-termion"] |
| 81 | +# include: |
| 82 | +# - build: linux |
| 83 | +# os: ubuntu-18.04 |
| 84 | +# rust: nightly |
| 85 | +# target: x86_64-unknown-linux-musl |
| 86 | +# - build: macos |
| 87 | +# os: macos-latest |
| 88 | +# rust: nightly |
| 89 | +# target: x86_64-apple-darwin |
| 90 | +# - build: linux-arm |
| 91 | +# os: ubuntu-18.04 |
| 92 | +# rust: nightly |
| 93 | +# target: arm-unknown-linux-gnueabihf |
| 94 | +# |
| 95 | +# |
| 96 | +# steps: |
| 97 | +# - name: Checkout repository |
| 98 | +# uses: actions/checkout@v1 |
| 99 | +# with: |
| 100 | +# fetch-depth: 1 |
| 101 | +# |
| 102 | +# - name: Install packages (Ubuntu) |
| 103 | +# if: matrix.os == 'ubuntu-18.04' |
| 104 | +# run: | |
| 105 | +# ci/ubuntu-install-packages |
| 106 | +# |
| 107 | +# - name: Install packages (macOS) |
| 108 | +# if: matrix.os == 'macos-latest' |
| 109 | +# run: | |
| 110 | +# ci/macos-install-packages |
| 111 | +# |
| 112 | +# - name: Install Rust |
| 113 | +# uses: actions-rs/toolchain@v1 |
| 114 | +# with: |
| 115 | +# toolchain: ${{ matrix.rust }} |
| 116 | +# profile: minimal |
| 117 | +# override: true |
| 118 | +# target: ${{ matrix.target }} |
| 119 | +# |
| 120 | +# - name: Use Cross |
| 121 | +# run: | |
| 122 | +# cargo install --git https://github.com/rust-embedded/cross |
| 123 | +# echo "::set-env name=CARGO::cross" |
| 124 | +# echo "::set-env name=TARGET_FLAGS::--target ${{ matrix.target }}" |
| 125 | +# echo "::set-env name=TARGET_DIR::./target/${{ matrix.target }}" |
| 126 | +# |
| 127 | +# - name: Show command used for Cargo |
| 128 | +# run: | |
| 129 | +# echo "cargo command is: ${{ env.CARGO }}" |
| 130 | +# echo "target flag is: ${{ env.TARGET_FLAGS }}" |
| 131 | +# echo "target dir is: ${{ env.TARGET_DIR }}" |
| 132 | +# |
| 133 | +# - name: Get release download URL |
| 134 | +# uses: actions/download-artifact@v1 |
| 135 | +# with: |
| 136 | +# name: artifacts |
| 137 | +# path: artifacts |
| 138 | +# |
| 139 | +# - name: Set release upload URL and release version |
| 140 | +# shell: bash |
| 141 | +# run: | |
| 142 | +# release_upload_url="$(cat artifacts/release-upload-url)" |
| 143 | +# echo "::set-env name=RELEASE_UPLOAD_URL::$release_upload_url" |
| 144 | +# echo "release upload url: $RELEASE_UPLOAD_URL" |
| 145 | +# release_version="$(cat artifacts/release-version)" |
| 146 | +# echo "::set-env name=RELEASE_VERSION::$release_version" |
| 147 | +# echo "release version: $RELEASE_VERSION" |
| 148 | +# |
| 149 | +# - name: Build release binary |
| 150 | +# run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} --no-default-features --features ${{ matrix.feature }} |
| 151 | +# |
| 152 | +# - name: Strip release binary (linux and macos) |
| 153 | +# if: matrix.build == 'linux' || matrix.build == 'macos' |
| 154 | +# shell: bash |
| 155 | +# run: strip target/${{ matrix.target }}/release/${{ env.BIN_NAME }}{,p} |
| 156 | +# |
| 157 | +# - name: Strip release binary (arm) |
| 158 | +# if: matrix.build == 'linux-arm' |
| 159 | +# run: | |
| 160 | +# docker run --rm -v \ |
| 161 | +# "$PWD/target:/target:Z" \ |
| 162 | +# rustembedded/cross:arm-unknown-linux-gnueabihf \ |
| 163 | +# arm-linux-gnueabihf-strip \ |
| 164 | +# /target/arm-unknown-linux-gnueabihf/release/${{ env.BIN_NAME }}{,p} |
| 165 | +# |
| 166 | +# - name: Build archive |
| 167 | +# shell: bash |
| 168 | +# run: | |
| 169 | +# staging="${{ env.BIN_NAME }}-${{ matrix.feature }}-${{ env.RELEASE_VERSION }}-${{ matrix.target }}" |
| 170 | +# mkdir -p "$staging" |
| 171 | +# |
| 172 | +# cp {README.md,LICENSE-*,CHANGELOG.md} "$staging/" |
| 173 | +# |
| 174 | +# cp target/${{ matrix.target }}/release/${{ env.BIN_NAME }}{,p} "$staging/" |
| 175 | +# tar czf "$staging.tar.gz" "$staging" |
| 176 | +# echo "::set-env name=ASSET::$staging.tar.gz" |
| 177 | +# |
| 178 | +# - name: Upload release archive |
| 179 | + |
| 180 | +# env: |
| 181 | +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 182 | +# with: |
| 183 | +# upload_url: ${{ env.RELEASE_UPLOAD_URL }} |
| 184 | +# asset_path: ${{ env.ASSET }} |
| 185 | +# asset_name: ${{ env.ASSET }} |
| 186 | +# asset_content_type: application/octet-stream |
| 187 | +# |
188 | 188 | release-windows:
|
189 | 189 | name: release
|
190 | 190 | needs: ['create-release']
|
191 |
| - runs-on: ${{ matrix.os }} |
| 191 | +# runs-on: ${{ matrix.os }} |
| 192 | + runs-on: ubuntu-18.04 |
192 | 193 | env:
|
193 | 194 | # For some builds, we use cross to test on 32-bit and big-endian
|
194 | 195 | # systems.
|
|
0 commit comments