File tree Expand file tree Collapse file tree 8 files changed +78
-257
lines changed Expand file tree Collapse file tree 8 files changed +78
-257
lines changed Original file line number Diff line number Diff line change
1
+ name : Rust
2
+
3
+ on :
4
+ push :
5
+ branches : [ master ]
6
+ tags : [ v* ]
7
+ pull_request :
8
+ branches : [ master ]
9
+
10
+ jobs :
11
+ test :
12
+ strategy :
13
+ matrix :
14
+ os : [ubuntu-latest, macos-latest]
15
+ rustv : [stable, beta, nightly]
16
+ runs-on : ${{ matrix.os }}
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+ - name : Install rust
20
+ uses : actions-rs/toolchain@v1
21
+ with :
22
+ toolchain : ${{ matrix.rustv }}
23
+ override : true
24
+ - name : Run cargo check
25
+ uses : actions-rs/cargo@v1
26
+ with :
27
+ command : check
28
+ - name : Run cargo test
29
+ uses : actions-rs/cargo@v1
30
+ with :
31
+ command : test
32
+ args : --verbose
33
+
34
+ release :
35
+ needs : test
36
+ if : startsWith(github.ref, 'refs/tags/')
37
+ strategy :
38
+ matrix :
39
+ runner :
40
+ - os : ubuntu-16.04
41
+ target : x86_64-unknown-linux-gnu
42
+ - os : macos-10.15
43
+ target : x86_64-apple-darwin
44
+ runs-on : ${{ matrix.runner.os }}
45
+ env :
46
+ TARGET : ${{ matrix.runner.target }}
47
+ PROJECT_NAME : git-fixup
48
+ REF : ${{ github.ref }}
49
+ steps :
50
+ - uses : actions/checkout@v2
51
+ - name : Install rust
52
+ uses : actions-rs/toolchain@v1
53
+ with :
54
+ toolchain : stable
55
+ target : ${{ matrix.runner.target }}
56
+ override : true
57
+ - name : Build Release
58
+ run : ./ci/build-release-artifacts.sh
59
+ - name : Upload Release
60
+ uses : softprops/action-gh-release@v1
61
+ with :
62
+ files : |
63
+ deployment/*.tar.gz
64
+ env :
65
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
# package the build artifacts
4
4
5
- set -ex
5
+ set -xeuo pipefail
6
6
7
7
. " $( dirname " $0 " ) /utils.sh"
8
8
. " $( dirname " $0 " ) /deploy_utils.sh"
@@ -13,10 +13,9 @@ mk_artifacts() {
13
13
}
14
14
15
15
main () {
16
- if [[ $TRAVIS_RUST_VERSION != stable ]]; then
17
- echo " Not building non-stable for deploy"
18
- return
19
- fi
16
+ echo " env: $( env) " >&2
17
+ export RELEASE
18
+ RELEASE=$( basename " $REF " )
20
19
mk_artifacts
21
20
mk_tarball
22
21
}
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -12,23 +12,23 @@ mk_temp() {
12
12
}
13
13
14
14
mk_tarball () {
15
- # When cross-compiling, use the right `strip` tool on the binary.
16
- local gcc_prefix=" $( gcc_prefix) "
15
+ local tmpdir out_dir name staging
17
16
# Create a temporary dir that contains our staging area.
18
17
# $tmpdir/$name is what eventually ends up as the deployed archive.
19
- local tmpdir=" $( mk_temp) "
20
- local name=" ${PROJECT_NAME} -${TRAVIS_TAG} -${TARGET} "
21
- local staging=" $tmpdir /$name "
18
+ tmpdir=" $( mk_temp) "
19
+ name=" ${PROJECT_NAME} -${RELEASE} -${TARGET} "
20
+ staging=" $tmpdir /$name "
21
+
22
22
# The deployment directory is where the final archive will reside.
23
- # This path is known by the .travis.yml configuration.
24
- local out_dir=" $( pwd) /deployment"
23
+ # This path is known by the github actions configuration.
24
+ out_dir=" $( pwd) /deployment"
25
25
mkdir -p " $staging " " $out_dir "
26
26
27
- # Copy the binary and strip it.
28
27
cp " target/$TARGET /release/git-fixup" " $staging /git-fixup"
29
- # Copy the licenses and README.
30
28
cp README.md LICENSE-{MIT,APACHE} " $staging /"
31
29
32
30
(cd " $tmpdir " && tar -czf " $out_dir /$name .tar.gz" " $name " )
33
31
rm -rf " $tmpdir "
32
+
33
+ ls " $out_dir /$name .tar.gz"
34
34
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,69 +16,9 @@ cargo_out_dir() {
16
16
| xargs dirname
17
17
}
18
18
19
- host () {
20
- case " $TRAVIS_OS_NAME " in
21
- linux)
22
- echo x86_64-unknown-linux-gnu
23
- ;;
24
- osx)
25
- echo x86_64-apple-darwin
26
- ;;
27
- esac
28
- }
29
-
30
- architecture () {
31
- case " $TARGET " in
32
- x86_64-* )
33
- echo amd64
34
- ;;
35
- i686-* |i586-* |i386-* )
36
- echo i386
37
- ;;
38
- arm* -unknown-linux-gnueabihf)
39
- echo armhf
40
- ;;
41
- * )
42
- die " architecture: unexpected target $TARGET "
43
- ;;
44
- esac
45
- }
46
-
47
- gcc_prefix () {
48
- case " $( architecture) " in
49
- armhf)
50
- echo arm-linux-gnueabihf-
51
- ;;
52
- * )
53
- return
54
- ;;
55
- esac
56
- }
57
-
58
- is_x86 () {
59
- case " $( architecture) " in
60
- amd64|i386) return 0 ;;
61
- * ) return 1 ;;
62
- esac
63
- }
64
-
65
- is_linux () {
66
- case " $TRAVIS_OS_NAME " in
67
- linux) return 0 ;;
68
- * ) return 1 ;;
69
- esac
70
- }
71
-
72
19
is_musl () {
73
20
case " $TARGET " in
74
21
* musl) return 0 ;;
75
22
* ) return 1 ;;
76
23
esac
77
24
}
78
-
79
- is_osx () {
80
- case " $TRAVIS_OS_NAME " in
81
- osx) return 0 ;;
82
- * ) return 1 ;;
83
- esac
84
- }
You can’t perform that action at this time.
0 commit comments