-
-
Notifications
You must be signed in to change notification settings - Fork 11
94 lines (78 loc) · 2.56 KB
/
release.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
name: Deploy Releases
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
create-crates-io-release:
name: create-crates-io-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Log in to crates.io
run: cargo login ${{ env.CRATES_IO_TOKEN }}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish to crates.io
run: cargo publish --allow-dirty
initialise-gh-release:
name: initialise-gh-release
runs-on: ubuntu-latest
steps:
- name: Get the release version from the tag
if: env.VERSION == ''
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Validate version environment variable
run: echo "Version being built against is ${{ env.VERSION }}"!
- name: Save version number to artifact
run: echo "${{ env.VERSION }}" > release-version
- name: Upload release-version as artifact
uses: actions/upload-artifact@v2
with:
retention-days: 3
name: release-version
path: release-version
build-release:
needs: [initialise-gh-release]
uses: ./.github/workflows/build_releases.yml
upload-release:
name: upload-release
runs-on: ubuntu-latest
needs: [build-release]
steps:
- name: Get release version
uses: actions/download-artifact@v3
with:
name: release-version
path: release-version
- name: Set release version
shell: bash
run: |
release_version="$(cat ./release-version/release-version)"
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Validate release version
run: |
echo "Release version: ${{ env.RELEASE_VERSION }}"
- name: Get release artifacts
uses: actions/download-artifact@v3
with:
name: release
path: release
- name: Print out all release files
run: |
echo "Generated $(ls ./release | wc -l) files:"
du -h -d 0 ./release/*
- name: Upload all saved release files
uses: softprops/action-gh-release@17cd0d34deddf848fc0e7d9be5202c148c270a0a # 0.1.14
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
tag_name: ${{ env.RELEASE_VERSION }}
draft: true
fail_on_unmatched_files: true
name: ${{ env.RELEASE_VERSION }} Release
body: |
<!-- Write summary here -->
files: |
./release/*