Skip to content

Commit fe466c5

Browse files
committed
Merge branch 'lint-ci' into 'master'
ci: lint GitHub workflows See merge request mkjeldsen/commitmsgfmt!40
2 parents b7ee2b3 + e28e39c commit fe466c5

File tree

2 files changed

+10
-44
lines changed

2 files changed

+10
-44
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ jobs:
4444
RUST_BACKTRACE: 1
4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@v2
47+
uses: actions/checkout@v4
4848

4949
- name: Install Rust
50-
uses: actions-rs/toolchain@v1
50+
uses: dtolnay/rust-toolchain@master
5151
with:
5252
toolchain: ${{ matrix.rust }}
53-
profile: minimal
54-
override: true
5553

5654
- name: Build
5755
run: cargo build --verbose

.github/workflows/release.yml

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,8 @@ on:
77

88
jobs:
99

10-
# First register a new release we can attach files to.
11-
create-release:
12-
name: create-release
13-
runs-on: ubuntu-latest
14-
outputs:
15-
version: ${{ steps.release_version.outputs.version }}
16-
upload_url: ${{ steps.release.outputs.upload_url }}
17-
steps:
18-
# Yes, we really need to get the plain tag name like this. There are even
19-
# dedicated actions for it.
20-
# https://stackoverflow.com/a/58178121/482758
21-
- name: Share release version
22-
id: release_version
23-
run: printf '::set-output name=version::%s\n' "${GITHUB_REF#refs/tags/}"
24-
25-
- name: Publish new release
26-
id: release
27-
uses: actions/create-release@v1
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
with:
31-
tag_name: ${{ steps.release_version.outputs.version }}
32-
release_name: ${{ steps.release_version.outputs.version }}
33-
3410
build-package:
3511
name: build-package
36-
needs:
37-
- create-release
3812
runs-on: ${{ matrix.os }}
3913
strategy:
4014
matrix:
@@ -64,15 +38,14 @@ jobs:
6438
TARGET_DIR: ./target
6539
steps:
6640
- name: Checkout
67-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
6842

6943
- name: Prepare environment
7044
shell: bash
7145
run: |
7246
printf 'TARGET_FLAGS=--target %s\n' "${{ matrix.target }}" >> $GITHUB_ENV
7347
printf 'TARGET_DIR=./target/${{ matrix.target }}\n' >> $GITHUB_ENV
74-
printf 'RELEASE_URL=%s\n' "${{ needs.create-release.outputs.upload_url }}" >> $GITHUB_ENV
75-
printf 'RELEASE_VERSION=%s\n' "${{ needs.create-release.outputs.version }}" >> $GITHUB_ENV
48+
printf 'RELEASE_VERSION=%s\n' "${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
7649
printf 'RELEASE_BINARY=%s\n' "target/${{ matrix.target }}/release/commitmsgfmt${{ matrix.binary_ext }}" >> $GITHUB_ENV
7750
7851
# So much cruft just to install Asciidoctor.
@@ -95,13 +68,11 @@ jobs:
9568
run: brew install asciidoctor
9669

9770
- name: Install Rust
98-
uses: actions-rs/toolchain@v1
71+
uses: dtolnay/rust-toolchain@master
9972
with:
10073
# Build all releases on nightly for latest optimizations.
10174
toolchain: nightly
102-
profile: minimal
103-
override: true
104-
target: ${{ matrix.target }}
75+
targets: ${{ matrix.target }}
10576

10677
- name: Install Cross
10778
run: cargo install cross
@@ -137,11 +108,8 @@ jobs:
137108
fi
138109
139110
- name: Upload package
140-
uses: actions/[email protected]
141-
env:
142-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
uses: softprops/action-gh-release@v1
143112
with:
144-
upload_url: ${{ env.RELEASE_URL }}
145-
asset_path: ${{ env.ASSET }}
146-
asset_name: ${{ env.ASSET }}
147-
asset_content_type: application/octet-stream
113+
draft: true
114+
tag_name: ${{ env.RELEASE_VERSION }}
115+
files: ${{ env.ASSET }}

0 commit comments

Comments
 (0)