-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,110 @@ | ||
name: Publish | ||
name: Publish latest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
binary: | ||
name: Publish binary for ${{ matrix.os }} | ||
upload_license: | ||
name: Upload License | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: LICENSE | ||
path: LICENSE | ||
|
||
build: | ||
name: Build cog ${{ matrix.os }}-${{ matrix.target }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# This should work with only the `include`s but it currently doesn't because of this bug: | ||
# https://gh.neting.ccmunity/t5/How-to-use-Git-and-GitHub/GitHub-Actions-Matrix-options-dont-work-as-documented/td-p/29558 | ||
target: [ x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, armv7-unknown-linux-musleabihf ] | ||
include: | ||
- os: ubuntu-22.04 | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-22.04 | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
- os: ubuntu-22.04 | ||
- os: ubuntu-latest | ||
target: armv7-unknown-linux-musleabihf | ||
|
||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-all-crates: "true" | ||
key: "${{ matrix.os }}-${{ matrix.target }}" | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
rust-version: stable | ||
toolchain: stable | ||
target: ${{ matrix.target }} | ||
|
||
- name: Install libssl-dev | ||
if: ${{ matrix.os == 'ubuntu-22.04' }} | ||
run: sudo apt-get update && sudo apt-get install cmake mingw-w64 | ||
|
||
- uses: actions/checkout@v1 | ||
- name: Build | ||
run: ci/action.sh release ${{ matrix.target }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.target }} | ||
path: target/${{ matrix.target }}/release/onagre | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
upload_to_release: | ||
needs: [ build, upload_license] | ||
name: Publish cog binaries | ||
runs-on: ubuntu-latest | ||
if: ${{ github.ref_type == 'tag' }} | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
path: ~/artifacts | ||
|
||
- name: Copy artifacts to archive | ||
run: | | ||
mkdir x86_64-unknown-linux-musl | ||
cp -r /home/runner/artifacts/x86_64-unknown-linux-musl/onagre x86_64-unknown-linux-musl/onagre | ||
chmod +x -R x86_64-unknown-linux-musl/onagre | ||
cp -r /home/runner/artifacts/LICENSE/LICENSE x86_64-unknown-linux-musl/ | ||
tar -czf onagre-x86_64-unknown-linux-musl.tar.gz x86_64-unknown-linux-musl/* | ||
mkdir x86_64-unknown-linux-gnu | ||
cp -r /home/runner/artifacts/x86_64-unknown-linux-gnu/onagre x86_64-unknown-linux-gnu/onagre | ||
chmod +x -R x86_64-unknown-linux-gnu/onagre | ||
cp -r /home/runner/artifacts/LICENSE/LICENSE x86_64-unknown-linux-gnu/ | ||
tar -czf onagre-x86_64-unknown-linux-gnu.tar.gz x86_64-unknown-linux-gnu/* | ||
mkdir armv7-unknown-linux-musleabihf | ||
cp -r /home/runner/artifacts/armv7-unknown-linux-musleabihf/onagre armv7-unknown-linux-musleabihf/onagre | ||
chmod +x -R armv7-unknown-linux-musleabihf/onagre | ||
cp -r /home/runner/artifacts/LICENSE/LICENSE armv7-unknown-linux-musleabihf/ | ||
tar -czf onagre-armv7-unknown-linux-musleabihf.tar.gz armv7-unknown-linux-musleabihf/* | ||
- uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/tar/onagre.tar.gz | ||
file: onagre-x86_64-unknown-linux-musl.tar.gz | ||
tag: ${{ github.ref }} | ||
asset_name: onagre-${{ steps.get_version.outputs.VERSION }}-${{ matrix.target }}.tar.gz | ||
asset_name: onagre-${{ github.ref_name }}-x86_64-unknown-linux-musl.tar.gz | ||
|
||
- uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: onagre-armv7-unknown-linux-musleabihf.tar.gz | ||
tag: ${{ github.ref_name }} | ||
asset_name: onagre-${{ github.ref_name }}-armv7-unknown-linux-musleabihf.tar.gz | ||
|
||
- uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: onagre-armv7-unknown-linux-musleabihf.tar.gz | ||
tag: ${{ github.ref_name }} | ||
asset_name: onagre-${{ github.ref_name }}-armv7-unknown-linux-musleabihf.tar.gz | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: SemVer release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{secrets.RELEASE_TOKEN}} | ||
|
||
- run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git config --global user.email github-actions@github.com | ||
git config --global user.name github-actions | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
|
||
- run: | ||
cargo install cargo-edit | ||
|
||
- run: | ||
cargo login ${{secrets.CARGO_TOKEN}} | ||
|
||
- name: SemVer release | ||
id: release | ||
uses: cocogitto/cocogitto-action@v3 | ||
with: | ||
check-latest-tag-only: true | ||
release: true | ||
git-user: 'github-actions' | ||
git-user-email: 'github-actions@github.com' | ||
|
||
- name: Generate Changelog | ||
run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md | ||
|
||
- name: Upload github release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: GITHUB_CHANGELOG.md | ||
tag_name: ${{ steps.release.outputs.version }} | ||
|
||
# - name: vuepress-deploy | ||
# uses: jenkey2011/vuepress-deploy@master | ||
# env: | ||
# COMMIT_MESSAGE: "chore: update gh-pages" | ||
# ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# BUILD_SCRIPT: cd docs && yarn && yarn docs:build | ||
# BUILD_DIR: website/.vuepress/dist/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.