Release #2
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
# largely copy-pasted from https://github.com/ebbflow-io/ebbflow/blob/0f1bfc988bedba7dee93e90e523cdacf1fb13ccb/.github/workflows/continuous-integration.yml | |
name: Release | |
# trigger using GH web ui / CLI | |
on: workflow_dispatch | |
jobs: | |
quickcheck: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.rustversion.outputs.rustversion }} | |
steps: | |
- uses: actions/checkout@v2 | |
- run: cargo check | |
- run: cargo pkgid | |
- run: 'echo "$(cargo pkgid | cut -d# -f2)"' | |
- id: rustversion | |
run: 'echo "::set-output name=rustversion::$(cargo pkgid | cut -d# -f2)"' | |
build: | |
needs: quickcheck | |
name: 'build-${{matrix.os}}' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
#os: [ubuntu-latest, windows-latest, macos-latest] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build | |
run: cargo build | |
- name: Run tests | |
run: cargo test | |
# fedorarpmbuild: | |
# needs: [build] | |
# runs-on: ubuntu-latest | |
# name: FedoraRpm | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: BuildRpm | |
# id: buildrpm | |
# uses: ebbflow-io/[email protected] | |
# - name: Upload RPM Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: fedorarpm | |
# path: ./target/x86_64-unknown-linux-musl/release/rpmbuild/RPMS/x86_64/* | |
# opensuseleaprpmbuild: | |
# needs: [build] | |
# runs-on: ubuntu-latest | |
# name: OpensuseLeapRpm | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: BuildRpm | |
# id: buildrpm | |
# uses: ebbflow-io/[email protected] | |
# - name: Upload RPM Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: opensuserpm | |
# path: ./target/x86_64-unknown-linux-musl/release/rpmbuild/RPMS/x86_64/* | |
debbuild: | |
needs: [build] | |
runs-on: ubuntu-latest | |
name: Amd64Deb | |
steps: | |
- uses: actions/checkout@v2 | |
- name: BuildDeb | |
id: debbuild | |
uses: ebbflow-io/[email protected] | |
- name: Upload Deb Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: amd64deb | |
path: ./target/x86_64-unknown-linux-musl/debian/* | |
raspbianbuild: | |
needs: [build] | |
runs-on: ubuntu-latest | |
name: Armv7Deb | |
steps: | |
- uses: actions/checkout@v2 | |
- name: BuildDeb | |
id: debbuild | |
uses: ebbflow-io/[email protected] | |
- name: Upload Deb Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: armv7deb | |
path: ./target/armv7-unknown-linux-musleabihf/debian/* | |
# windowsbuild: | |
# needs: [build] | |
# runs-on: windows-latest | |
# env: | |
# RUSTFLAGS: '-C target-feature=+crt-static' | |
# name: Windows | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - uses: actions-rs/toolchain@v1 | |
# with: | |
# toolchain: stable | |
# - uses: actions-rs/[email protected] | |
# with: | |
# crate: cargo-wix | |
# version: latest | |
# - run: cargo wix -v --nocapture -o . | |
# - name: Upload MSI Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: windows | |
# path: ./*.msi | |
# macosbuild: | |
# needs: [build, quickcheck] | |
# runs-on: macos-latest | |
# name: MacOS | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build | |
# run: cargo build --release | |
# - name: Zip up macos binaries | |
# run: 'zip -j forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip ./target/release/forward-as-attachment-mta' | |
# - name: Upload Zipped Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: macos | |
# path: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip' | |
# - name: Upload Bin Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: macos | |
# path: ./target/release/forward-as-attachment-mta | |
# - name: Upload Daemon Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: macos | |
# path: ./target/release/forward-as-attachment-mta | |
amd64binaries: | |
needs: [build, quickcheck] | |
runs-on: ubuntu-latest | |
name: Amd64StaticBinaries | |
steps: | |
- uses: actions/checkout@v2 | |
- name: StaticBinaryBuild | |
id: amd64staticbuild | |
uses: ebbflow-io/[email protected] | |
with: | |
cmd: cargo build --release --target=x86_64-unknown-linux-musl | |
- name: Upload Daemon Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: amd64binaries | |
path: ./target/x86_64-unknown-linux-musl/release/forward-as-attachment-mta | |
arm7binaries: | |
needs: [build, quickcheck] | |
runs-on: ubuntu-latest | |
name: Armv7StaticBinaries | |
steps: | |
- uses: actions/checkout@v2 | |
- name: StaticBinaryBuild | |
id: armv7statibuild | |
uses: ebbflow-io/[email protected] | |
with: | |
cmd: cargo build --release --target=armv7-unknown-linux-musleabihf | |
- name: Upload Daemon Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: armv7binaries | |
path: ./target/armv7-unknown-linux-musleabihf/release/forward-as-attachment-mta | |
update_release_draft: | |
#needs: [quickcheck, arm7binaries, amd64binaries, macosbuild, windowsbuild, raspbianbuild, debbuild, opensuseleaprpmbuild, fedorarpmbuild] | |
needs: [quickcheck, arm7binaries, amd64binaries, raspbianbuild, debbuild] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: '${{ needs.quickcheck.outputs.version }}' | |
release_name: Release ${{ needs.quickcheck.outputs.version }} | |
body: 'Change Me' | |
draft: true | |
prerelease: false | |
- uses: actions/download-artifact@v2 | |
- run: ls -lha | |
- name: Upload amd64 deb 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: ./amd64deb/forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_amd64.deb | |
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_amd64.deb' | |
asset_content_type: application/vnd.debian.binary-package | |
- name: Upload armv7 deb 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: ./armv7deb/forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_armhf.deb | |
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_armhf.deb' | |
asset_content_type: application/vnd.debian.binary-package | |
# - name: Upload amd64 rpm fedora 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: ./fedorarpm/forward-as-attachment-mta-${{needs.quickcheck.outputs.version}}-1.x86_64.rpm | |
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}-1_amd64_fedora.rpm' | |
# asset_content_type: application/octet-stream | |
# - name: Upload amd64 rpm opensuse 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: ./opensuserpm/forward-as-attachment-mta-${{needs.quickcheck.outputs.version}}-1.x86_64.rpm | |
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}-1_amd64_opensuseleap.rpm' | |
# asset_content_type: application/octet-stream | |
# - name: Upload Windows 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: ./windows/forward-as-attachment-mta-${{needs.quickcheck.outputs.version}}-x86_64.msi | |
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}.msi' | |
# asset_content_type: application/octet-stream | |
# - name: Upload Macos 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: ./macos/forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip | |
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip' | |
# asset_content_type: application/zip | |
- name: Upload Armv7 Static Binary Zip 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: ./armv7binaries/forward-as-attachmenta-mta | |
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_linux_armv7' | |
asset_content_type: application/octet-stream | |
- name: Upload Amd64 Static Binary Zip 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: ./amd64binaries/forward-as-attachment-mta | |
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_linux_amd64' | |
asset_content_type: application/octet-stream |