Update CHANGELOG.md
#41
Workflow file for this run
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
on: | |
push: | |
# # Sequence of patterns matched against refs/tags | |
tags: | |
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Mean Bean Deploy | |
env: | |
BIN: rustywind | |
jobs: | |
# This job downloads and stores `cross` as an artifact, so that it can be | |
# re-downloaded across all of the jobs. Currently this copied pasted between | |
# `mean_bean_ci.yml` and `mean_bean_deploy.yml`. Make sure to update both places when making | |
# changes. | |
install-cross: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 50 | |
- uses: XAMPPRocky/get-github-release@v1 | |
id: cross | |
with: | |
owner: rust-embedded | |
repo: cross | |
matches: ${{ matrix.platform }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cross-${{ matrix.platform }} | |
path: ${{ steps.cross.outputs.install_path }} | |
strategy: | |
matrix: | |
platform: [linux-musl] | |
windows: | |
runs-on: windows-latest | |
needs: install-cross | |
strategy: | |
matrix: | |
target: | |
# MSVC | |
- i686-pc-windows-msvc | |
- x86_64-pc-windows-msvc | |
# GNU | |
# - i686-pc-windows-gnu | |
# - x86_64-pc-windows-gnu | |
steps: | |
- name: Get tag | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
- uses: actions/checkout@v3 | |
- run: bash ci/set_rust_version.bash stable ${{ matrix.target }} | |
- run: bash ci/build.bash cargo ${{ matrix.target }} RELEASE | |
- run: | | |
cd ./target/${{ matrix.target }}/release/ | |
7z a "${{ env.BIN }}.zip" "${{ env.BIN }}.exe" | |
mv "${{ env.BIN }}.zip" $GITHUB_WORKSPACE | |
shell: bash | |
# We're using using a fork of `actions/create-release` that detects | |
# whether a release is already available or not first. | |
- uses: XAMPPRocky/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
# Draft should **always** be false. GitHub doesn't provide a way to | |
# get draft releases from its API, so there's no point using it. | |
draft: false | |
prerelease: false | |
- uses: actions/upload-artifact@v4 | |
id: upload-release-asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.BIN }}.zip | |
asset_name: ${{ env.BIN }}-${{steps.tag.outputs.tag}}-${{ matrix.target }}.zip | |
asset_content_type: application/zip | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: | |
# macOS | |
- x86_64-apple-darwin | |
- aarch64-apple-darwin | |
# iOS | |
# - aarch64-apple-ios | |
# - armv7-apple-ios | |
# - armv7s-apple-ios | |
# - i386-apple-ios | |
# - x86_64-apple-ios | |
steps: | |
- name: Get tag | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
# Cache files between builds | |
- name: Setup | Cache Cargo | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup | Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
- name: Build | Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target ${{ matrix.target }} | |
use-cross: ${{ matrix.os == 'ubuntu-latest' }} | |
- run: tar -czvf ${{ env.BIN }}.tar.gz --directory=target/${{ matrix.target }}/release ${{ env.BIN }} | |
- uses: XAMPPRocky/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- uses: actions/upload-release-asset@v1 | |
id: upload-release-asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.BIN }}.tar.gz | |
asset_name: ${{ env.BIN }}-${{steps.tag.outputs.tag}}-${{ matrix.target }}.tar.gz | |
asset_content_type: application/gzip | |
linux: | |
runs-on: ubuntu-latest | |
needs: install-cross | |
strategy: | |
matrix: | |
target: | |
## WASM, off by default as most rust projects aren't compatible yet. | |
# - wasm32-unknown-emscripten | |
## Linux | |
- aarch64-unknown-linux-gnu | |
- aarch64-unknown-linux-musl | |
- arm-unknown-linux-gnueabi | |
- arm-unknown-linux-gnueabihf | |
- armv7-unknown-linux-gnueabihf | |
- i686-unknown-linux-musl | |
- x86_64-unknown-linux-musl | |
# - i686-unknown-linux-gnu | |
# - mips-unknown-linux-gnu | |
# - mips64-unknown-linux-gnuabi64 | |
# - mips64el-unknown-linux-gnuabi64 | |
# - mipsel-unknown-linux-gnu | |
# - powerpc-unknown-linux-gnu | |
# - powerpc64-unknown-linux-gnu | |
# - s390x-unknown-linux-gnu | |
# - x86_64-unknown-linux-gnu | |
## Android | |
# - aarch64-linux-android | |
# - arm-linux-androideabi | |
# - armv7-linux-androideabi | |
# - i686-linux-android | |
# - x86_64-linux-android | |
## *BSD | |
# The FreeBSD targets can have issues linking so they are disabled | |
# by default. | |
# - i686-unknown-freebsd | |
# - x86_64-unknown-freebsd | |
# - x86_64-unknown-netbsd | |
## Solaris | |
# - sparcv9-sun-solaris | |
## Bare Metal | |
# These are no-std embedded targets, so they will only build if your | |
# crate is `no_std` compatible. | |
# - thumbv6m-none-eabi | |
# - thumbv7em-none-eabi | |
# - thumbv7em-none-eabihf | |
# - thumbv7m-none-eabi | |
steps: | |
- name: Get tag | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: cross-linux-musl | |
path: /tmp/ | |
- run: chmod +x /tmp/cross | |
- run: ci/set_rust_version.bash stable ${{ matrix.target }} | |
- run: ci/build.bash /tmp/cross ${{ matrix.target }} RELEASE | |
- run: tar -czvf ${{ env.BIN }}.tar.gz --directory=target/${{ matrix.target }}/release ${{ env.BIN }} | |
- uses: XAMPPRocky/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- 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: ${{ env.BIN }}.tar.gz | |
asset_name: ${{ env.BIN }}-${{steps.tag.outputs.tag}}-${{ matrix.target }}.tar.gz | |
asset_content_type: application/gzip | |
docker: | |
needs: linux | |
runs-on: ubuntu-latest | |
name: Build Docker image for tagged release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
avencera/rustywind | |
ghcr.io/avencera/rustywind | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{raw}} | |
type=semver,pattern={{major}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}}.{{minor}}.{{patch}} | |
type=semver,pattern=v{{major}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
type=semver,pattern=v{{major}}.{{minor}}.{{patch}} | |
type=sha | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Login to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |