Skip to content

Commit 4496779

Browse files
committed
Updated release action
1 parent 4aa44a4 commit 4496779

File tree

1 file changed

+43
-39
lines changed

1 file changed

+43
-39
lines changed

.github/workflows/sync-release-version.yml

+43-39
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,8 @@ on:
55

66

77
jobs:
8-
publish:
9-
name: Publish to crates.io
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions-rs/toolchain@v1
14-
with:
15-
toolchain: stable
16-
override: true
17-
- uses: katyo/publish-crates@v1
18-
with:
19-
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
20-
21-
release:
22-
name: release ${{ matrix.target }}
23-
runs-on: ubuntu-latest
24-
strategy:
25-
fail-fast: false
26-
matrix:
27-
include:
28-
- target: x86_64-pc-windows-gnu
29-
archive: zip
30-
- target: x86_64-unknown-linux-musl
31-
archive: tar.gz tar.xz tar.zst
32-
- target: x86_64-apple-darwin
33-
archive: zip
34-
35-
steps:
36-
- uses: actions/checkout@v3
37-
- name: Compile and release
38-
uses: rust-build/[email protected]
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
with:
42-
RUSTTARGET: ${{ matrix.target }}
43-
ARCHIVE_TYPES: ${{ matrix.archive }}
44-
EXTRA_FILES: "README.md LICENSE"
45-
468
update-version:
479
runs-on: ubuntu-latest
48-
needs: release
4910
steps:
5011
- uses: actions/checkout@v3
5112
with:
@@ -70,6 +31,8 @@ jobs:
7031
uses: tj-actions/[email protected]
7132
with:
7233
output: 'HISTORY.md'
34+
- name: Bump version
35+
uses: tj-actions/cargo-bump@v2
7336
- name: Get branch name
7437
id: branch-name
7538
uses: tj-actions/branch-names@v6
@@ -81,6 +44,7 @@ jobs:
8144
README.md
8245
HISTORY.md
8346
entrypoint.sh
47+
Cargo.toml
8448
- name: Commit changes
8549
if: steps.verify-changed-files.outputs.files_changed == 'true'
8650
run: |
@@ -102,3 +66,43 @@ jobs:
10266
branch: "chore/upgrade-to-${{ steps.sync-release-version.outputs.new_version }}"
10367
body: "View [CHANGES](https://github.com/${{ github.repository }}/compare/${{ steps.sync-release-version.outputs.old_version }}...${{ steps.sync-release-version.outputs.new_version }})"
10468
token: ${{ secrets.PAT_TOKEN }}
69+
70+
publish:
71+
name: Publish to crates.io
72+
runs-on: ubuntu-latest
73+
needs: update-version
74+
steps:
75+
- uses: actions/checkout@v3
76+
- uses: actions-rs/toolchain@v1
77+
with:
78+
toolchain: stable
79+
override: true
80+
- uses: katyo/publish-crates@v1
81+
with:
82+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
83+
84+
release:
85+
name: release ${{ matrix.target }}
86+
runs-on: ubuntu-latest
87+
needs: update-version
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
include:
92+
- target: x86_64-pc-windows-gnu
93+
archive: zip
94+
- target: x86_64-unknown-linux-musl
95+
archive: tar.gz tar.xz tar.zst
96+
- target: x86_64-apple-darwin
97+
archive: zip
98+
99+
steps:
100+
- uses: actions/checkout@v3
101+
- name: Compile and release
102+
uses: rust-build/[email protected]
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
with:
106+
RUSTTARGET: ${{ matrix.target }}
107+
ARCHIVE_TYPES: ${{ matrix.archive }}
108+
EXTRA_FILES: "README.md LICENSE"

0 commit comments

Comments
 (0)