Skip to content

Commit 0152197

Browse files
committed
See if linux runner can indeed build windows
related to #19
1 parent 4f656b2 commit 0152197

File tree

1 file changed

+134
-133
lines changed

1 file changed

+134
-133
lines changed

.github/workflows/release.yml

Lines changed: 134 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
name: release
1414
on:
1515
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
1919
tags:
2020
- 'v[0-9]+.[0-9]+.[0-9]+'
2121
jobs:
2222
create-release:
2323
name: create-release
2424
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
2828
steps:
2929
- name: Create artifacts directory
3030
run: mkdir artifacts
@@ -59,136 +59,137 @@ jobs:
5959
name: artifacts
6060
path: artifacts
6161

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-
uses: actions/[email protected]
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+
# uses: actions/[email protected]
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+
#
188188
release-windows:
189189
name: release
190190
needs: ['create-release']
191-
runs-on: ${{ matrix.os }}
191+
# runs-on: ${{ matrix.os }}
192+
runs-on: ubuntu-18.04
192193
env:
193194
# For some builds, we use cross to test on 32-bit and big-endian
194195
# systems.

0 commit comments

Comments
 (0)