Skip to content

Commit

Permalink
chore(ci): rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebradil committed Dec 4, 2023
1 parent 016081e commit ed59eb6
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 125 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/build.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/flow-push-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: Push to master

on:
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo test
run: cargo test --verbose
build:
needs:
- test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: windows-latest
bin_path: target\\release\\totp.exe
- os: macos-latest
bin_path: target/release/totp
- os: ubuntu-latest
bin_path: target/release/totp
steps:
- name: Install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Checkout
uses: actions/checkout@v4
- name: Cache target directory
uses: actions/cache@v2
with:
path: target
key: ${{ runner.OS }}-target-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-target-${{ github.ref }}-
${{ runner.OS }}-target-master-
${{ runner.OS }}-target-
- name: Cargo build release
run: cargo build --verbose --release
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: ${{ matrix.bin_path }}
if-no-files-found: error
# The artifact is only needed for the current workflow run
retention-days: 1
release:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.ZEBRADIL_BOT_GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: List artifacts
run: find artifact
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.ZEBRADIL_BOT_GITHUB_TOKEN }}
GIT_AUTHOR_NAME: Zebradli Bot
GIT_AUTHOR_EMAIL: german.lashevich+github-zebradil-bot@gmail.com
GIT_COMMITTER_NAME: Zebradli Bot
GIT_COMMITTER_EMAIL: german.lashevich+github-zebradil-bot@gmail.com
with:
extra_plugins: |
@semantic-release/git
22 changes: 0 additions & 22 deletions .github/workflows/release.yml

This file was deleted.

68 changes: 0 additions & 68 deletions .github/workflows/upload-release-assets.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
branches:
- master
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
- "@semantic-release/git"
- - "@semantic-release/github"
- assets:
- path: artifacts/ubuntu-latest/totp
name: totp-linux
- path: artifacts/macos-latest/totp
name: totp-macos
- path: artifacts/windows-latest/totp.exe
name: totp-windows.exe
- "semantic-release-cargo"
tagFormat: "${version}"

0 comments on commit ed59eb6

Please sign in to comment.