Skip to content

Commit

Permalink
Merge branch 'riscv-non-isa:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kito-cheng authored Sep 26, 2024
2 parents 91c221f + f2d324f commit 66b7a17
Show file tree
Hide file tree
Showing 49 changed files with 4,925 additions and 818 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build

on:
push:
branches:
- master
pull_request:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install packages
run: sudo apt-get update && sudo apt-get install -y make ruby

- name: Install gems
run: sudo gem install asciidoctor asciidoctor-pdf

- name: Build
run: make

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: riscv-abi.pdf
path: riscv-abi.pdf

draft-release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: riscv-abi.pdf
path: ./

- name: Get current date
id: date
run: echo "::set-output name=date::$(date -u +'%Y%m%d')"

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: draft-${{ steps.date.outputs.date }}-${{ github.sha }}
release_name: Draft release ${{ steps.date.outputs.date }}
body: Latest snapshot (${{ github.sha }})
prerelease: true

- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: riscv-abi.pdf
asset_name: riscv-abi.pdf
asset_content_type: application/pdf

release:
if: github.event_name == 'release' && github.event.action == 'created'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: riscv-abi.pdf
path: ./

- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: riscv-abi.pdf
asset_name: riscv-abi.pdf
asset_content_type: application/pdf
20 changes: 20 additions & 0 deletions .github/workflows/remove-old-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Remove old artifacts

on:
workflow_dispatch:
schedule:
# Every day at 1am
- cron: '0 1 * * *'

jobs:
remove-old-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '1 month'
skip-tags: true
skip-recent: 10
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.swp
build/
*.pdf
Loading

0 comments on commit 66b7a17

Please sign in to comment.