Skip to content

Commit

Permalink
Test release.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekitdev committed May 28, 2024
1 parent e7ae1a4 commit b831208
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: release

on:
push:
tags:
- v*
on: workflow_dispatch

jobs:
build:
Expand Down Expand Up @@ -35,7 +32,7 @@ jobs:
env:
file: ${{ matrix.config.output }}
copy: target/release/${{ matrix.config.output }}
name: changelogging-${{ github.ref_name }}-${{ matrix.config.target }}
target: ${{ matrix.config.target }}

steps:
- name: Checkout
Expand All @@ -46,6 +43,17 @@ jobs:
with:
targets: ${{ matrix.config.target }}

- name: Install cargo-get
run: cargo install cargo-get

- name: Get version
shell: bash
run: echo "version=$(cargo get package.version)" >> "$GITHUB_ENV"

- name: Get name
shell: bash
run: echo "name=changelogging-$version-$target" >> "$GITHUB_ENV"

- name: Build
run: cargo build --release

Expand Down Expand Up @@ -80,7 +88,6 @@ jobs:

env:
archives: archives
changelog: CHANGELOG-${{ github.ref_name }}.md
name: nekit[bot]
email: [email protected]

Expand All @@ -95,7 +102,25 @@ jobs:
path: ${{ env.archives }}
merge-multiple: true

- name: Build changelog ${{ github.ref_name }}
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install cargo-get
run: cargo install cargo-get

- name: Get version
shell: bash
run: echo "version=$(cargo get package.version)" >> "$GITHUB_ENV"

- name: Get name
shell: bash
run: echo "changelog=CHANGELOG-$version.md" >> "$GITHUB_ENV"

- name: Get tag
shell: bash
run: echo "tag=v$version" >> "$GITHUB_ENV"

- name: Build changelog ${{ env.version }}
run: cargo run preview > ${{ env.changelog }}

- name: Build changelog
Expand All @@ -113,15 +138,18 @@ jobs:
run: git checkout main

- name: Commit
run: git commit --message "Add ${{ github.ref_name }} to the changelog."
run: git commit --message "Add ${{ env.version }} to the changelog."

- name: Tag
run: git tag ${{ env.tag }}

- name: Push
run: git push --set-upstream origin main
run: git push --set-upstream --atomic origin main ${{ env.tag }}

- name: Release
uses: softprops/action-gh-release@v2

with:
body_path: ${{ env.changelog }}

tag_name: ${{ env.tag }}
files: ${{ env.archives }}/*

0 comments on commit b831208

Please sign in to comment.