Skip to content

Commit ff2d356

Browse files
committed
chore: add github actions configuration
1 parent a947198 commit ff2d356

1 file changed

Lines changed: 9 additions & 48 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,11 @@ name: Release
33
on:
44
push:
55
branches:
6-
- "stable"
6+
- main
77

88
jobs:
9-
create-release:
10-
name: Create Release
11-
runs-on: ubuntu-latest
12-
outputs:
13-
upload_url: ${{ steps.create_release.outputs.upload_url }}
14-
version: ${{ steps.extract_version.outputs.version }}
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v5
18-
19-
- name: Install Rust toolchain
20-
uses: actions-rs/toolchain@v1
21-
with:
22-
toolchain: stable
23-
override: true
24-
25-
- name: Extract version
26-
id: extract_version
27-
run: |
28-
version $(cargo metadata --foramt-version 1 --no-deps | jq ".packages[0].version")
29-
echo "version=$version" >> "$GITHUB_OUTPUT"
30-
31-
- name: Create Release
32-
id: create_release
33-
uses: actions/create-release@v1.1.4
34-
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
with:
37-
tag_name: ${{ github.ref_name }}
38-
release_name: txtcv ${{ github.ref_name }}
39-
target_commitish: ${{ github.sha }}
40-
draft: false
41-
prerelease: false
42-
43-
build-and-upload:
9+
build:
4410
name: Build and Upload for ${{ matrix.os }}
45-
needs: create-release
4611
runs-on: ${{ matrix.os }}
4712
strategy:
4813
matrix:
@@ -64,17 +29,13 @@ jobs:
6429
- name: Build binary
6530
run: cargo build --release --all-features
6631

32+
- name: Extract version
33+
id: extract_version
34+
run: |
35+
version $(cargo metadata --format-version 1 --no-deps | jq ".packages[0].version")
36+
echo "version=$version" >> "$GITHUB_OUTPUT"
37+
6738
- name: Package artifact
6839
run: |
69-
artifact_name=txtcv-${{ needs.create-release.outputs.version }}-${{ matrix.target }}.tar.gz
40+
artifact_name=txtcv-${{ steps.extract_version.outputs.version }}-${{ matrix.target }}.tar.gz
7041
tar -C target/release -czf "$artifact_name" txtcv.tar.gz
71-
72-
- name: Upload binary
73-
uses: actions/upload-release-asset@v1
74-
env:
75-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
with:
77-
upload_url: ${{ needs.create-release.outputs.upload_url }}
78-
asset_path: ./txtcv-${{ needs.create-release.outputs.version }}-${{ matrix.target }}.tar.gz
79-
asset_name: txtcv-${{ needs.create-release.outputs.version }}-${{ matrix.target }}.tar.gz
80-
asset_content_type: application/gzip

0 commit comments

Comments
 (0)