Skip to content

Commit

Permalink
chore(ci): upgrade actions
Browse files Browse the repository at this point in the history
  • Loading branch information
graelo committed Aug 16, 2024
1 parent a04a434 commit ca7aadd
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 25 deletions.
68 changes: 68 additions & 0 deletions .convco
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
header: |
# Changelog
types:
- type: feat
increment: Minor
section: Features
hidden: false
- type: fix
increment: Patch
section: Fixes
hidden: false
- type: build
increment: None
section: Other
hidden: true
- type: chore
increment: None
section: Other
hidden: true
- type: ci
increment: None
section: Other
hidden: true
- type: docs
increment: None
section: Documentation
hidden: true
- type: style
increment: None
section: Other
hidden: true
- type: refactor
increment: None
section: Other
hidden: true
- type: perf
increment: None
section: Other
hidden: true
- type: test
increment: None
section: Other
hidden: true
preMajor: false
commitUrlFormat: '{{@root.host}}/{{@root.owner}}/{{@root.repository}}/commit/{{hash}}'
compareUrlFormat: '{{@root.host}}/{{@root.owner}}/{{@root.repository}}/compare/{{previousTag}}...{{currentTag}}'
issueUrlFormat: '{{@root.host}}/{{@root.owner}}/{{@root.repository}}/issues/{{issue}}'
userUrlFormat: '{{host}}/{{user}}'
releaseCommitMessageFormat: 'chore(release): {{currentTag}}'
issuePrefixes:
- '#'
host: null
owner: null
repository: null
template: null
commitTemplate: null
scopeRegex: ^[[:alnum:]]+(?:[-_/][[:alnum:]]+)*$
lineLength: 80
wrapDisabled: false
linkCompare: true
linkReferences: true
merges: false
firstParent: false
stripRegex: ''
description:
length:
min: 10
max: null
17 changes: 10 additions & 7 deletions .github/workflows/essentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:
jobs:
test:
name: Quality checks & tests
# runs-on: self-hosted
runs-on: macos-14
runs-on: macos-latest
strategy:
matrix:
rust: [stable]
Expand All @@ -23,12 +22,14 @@ jobs:
components: rustfmt, clippy

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.pull_request.commits }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
# fetch-depth: ${{ github.event.pull_request.commits }}

- name: Cache crates from crates.io
uses: actions/cache@v3
uses: actions/cache@v4
continue-on-error: false
with:
path: |
Expand All @@ -50,10 +51,12 @@ jobs:
- name: Quality - convco check
run: |
git show-ref
curl -sSfLO https://github.com/convco/convco/releases/download/v0.4.1/convco-macos.zip
echo Commit message: "$(git log -1 --pretty=%B)"
curl -sSfLO https://github.com/convco/convco/releases/latest/download/convco-macos.zip
unzip convco-macos.zip
chmod +x convco
./convco check
./convco --version
./convco check -c .convco
rm convco
- name: Quality - cargo deny check
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
strategy:
matrix:
include:
# - os: self-hosted
- os: macos-14
- os: macos-latest
target: aarch64-apple-darwin
rust: stable
suffix: ''
Expand All @@ -26,10 +25,10 @@ jobs:
components: rustfmt, clippy

- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache crates from crates.io
uses: actions/cache@v3
uses: actions/cache@v4
continue-on-error: false
with:
path: |
Expand All @@ -44,7 +43,7 @@ jobs:
run: cargo build --release

- name: Compress to zip (macOS)
if: ${{ matrix.os == 'self-hosted' }}
if: ${{ matrix.os == 'macos-latest' }}
run:
zip -A ${{ github.event.repository.name }}-${{ matrix.target }}.${{ matrix.archive_ext }} target/release/${{ github.event.repository.name }}

Expand All @@ -55,44 +54,44 @@ jobs:
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ matrix.target }}.${{ matrix.archive_ext }}
path: ${{ github.event.repository.name }}-${{ matrix.target }}.${{ matrix.archive_ext }}

release:
name: Create a GitHub Release
# if: github.ref == 'refs/heads/main'
runs-on: self-hosted
runs-on: macos-latest
permissions:
contents: write
needs:
- prepare-artifacts
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# convco needs all history to create the changelog
fetch-depth: 0

- name: Extract version
id: extract-version
run: |
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
echo "tag-name=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
- name: Download convco
run: |
git show-ref
curl -sSfLO https://github.com/convco/convco/releases/download/v0.4.1/convco-macos.zip
curl -sSfLO https://github.com/convco/convco/releases/latest/download/convco-macos.zip
unzip convco-macos.zip
chmod +x convco
- name: Use convco to create the changelog
run: |
./convco changelog --max-versions 1 --include-hidden-sections > CHANGELOG.md
./convco changelog -c .convco --max-versions 1 --include-hidden-sections > CHANGELOG.md
rm convco convco-macos.zip
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}-aarch64-apple-darwin.zip

Expand All @@ -105,16 +104,16 @@ jobs:
homebrew:
name: Bump Homebrew formula
# if: github.ref == 'refs/heads/main'
runs-on: self-hosted
runs-on: macos-latest
needs:
- release
steps:
- name: Extract version
id: extract-version
run: |
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
echo "tag-name=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
- uses: mislav/bump-homebrew-formula-action@v2
- uses: mislav/bump-homebrew-formula-action@v3
if: "!contains(github.ref, '-')" # skip prereleases
with:
formula-name: pumas
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![crate](https://img.shields.io/crates/v/pumas.svg)](https://crates.io/crates/pumas)
[![documentation](https://docs.rs/pumas/badge.svg)](https://docs.rs/pumas)
[![minimum rustc 1.64](https://img.shields.io/badge/rustc-1.64+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![minimum rustc 1.74](https://img.shields.io/badge/rustc-1.74+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![rust 2021 edition](https://img.shields.io/badge/edition-2021-blue.svg)](https://doc.rust-lang.org/edition-guide/rust-2021/index.html)
<!-- [![build status](https://github.com/graelo/pumas/actions/workflows/essentials.yml/badge.svg)](https://github.com/graelo/pumas/actions/workflows/essentials.yml) -->

Expand Down
4 changes: 2 additions & 2 deletions ci/test_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

CRATE=pumas
MSRV=1.64
MSRV=1.74

get_rust_version() {
local array=($(rustc --version));
Expand All @@ -28,7 +28,7 @@ if ! check_version $MSRV ; then
fi

FEATURES=()
# check_version 1.64 && FEATURES+=(libm)
# check_version 1.74 && FEATURES+=(libm)
echo "Testing supported features: ${FEATURES[*]}"

set -x
Expand Down

0 comments on commit ca7aadd

Please sign in to comment.