-
Notifications
You must be signed in to change notification settings - Fork 21
107 lines (104 loc) · 2.82 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: floki-ci
on:
push:
tags:
# Full version
- "[0-9]+.[0-9]+.[0-9]+"
# Prerelease version
- "[0-9]+.[0-9]+.[0-9]+-*"
pull_request:
branches:
# Trigger on pull requests into main
- main
types: [ opened, synchronize ]
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- ubuntu-20.04
- macos-latest
rust:
- stable
- beta
experimental: [false]
include:
- os: ubuntu-20.04
rust: nightly
experimental: true
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Run cargo clippy to pick up any errors
uses: actions-rs/cargo@v1
if: ${{ matrix.rust == 'stable' }}
with:
toolchain: ${{ matrix.rust }}
command: clippy
args: -- -Dwarnings
- run: pip3 install -U tomlq
- run: "./build.sh"
env:
OS_NAME: ${{ matrix.os }}
- name: Archive artifacts
uses: actions/upload-artifact@v3
if: ${{ matrix.rust == 'stable' }}
with:
name: stableartifacts
path: |
floki*.zip
floki*.tar.gz
publish:
runs-on: ubuntu-20.04
needs:
- build
steps:
- uses: actions/checkout@v3
- run: pip3 install -U tomlq
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Publish to crates.io on tags
uses: actions-rs/cargo@v1
if: startsWith(github.ref, 'refs/tags/')
with:
toolchain: stable
command: publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.PUBLISH_SECRET }}
- name: Dry-run publish on non-tags
uses: actions-rs/cargo@v1
if: startsWith(github.ref, 'refs/tags/') != true
with:
toolchain: stable
command: publish
args: --dry-run
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.PUBLISH_SECRET }}
# After publishing, create a release
- name: Download archives
uses: actions/download-artifact@v3
with:
name: stableartifacts
- name: Generate release.txt
run: "./changelog.sh"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: release.txt
token: ${{ secrets.PAT_GITHUB }}
files: |
floki*.zip
floki*.tar.gz
# Announce the release
- run: "./announce.sh"
if: startsWith(github.ref, 'refs/tags/')
env:
ANNOUNCE_HOOK: ${{ secrets.ANNOUNCE_HOOK }}