add time to version #84
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
name: dev-build | |
on: | |
push: | |
branches: [ wip/build-xpi ] | |
env: | |
XPI_NAME: tabmix-dev-build | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Set version in install.rdf | |
run: | | |
version=$(git tag --sort=-creatordate | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n 1 | cut -c 2-) | |
date=$(date +'%Y%m%d.%H%M') | |
sed -i "s/1.0.0-unbundeled/$version-$date/" addon/install.rdf | |
- name: Zip addon folder | |
run: | | |
cd addon | |
zip -rq ../${{ env.XPI_NAME }}.xpi * | |
- name: Upload XPI to artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.XPI_NAME }} | |
path: ${{ env.XPI_NAME }}.xpi | |
- name: Download XPI from artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.XPI_NAME }} | |
- name: Update dev-build tag | |
run: | | |
git tag -d dev-build && git tag dev-build $(git rev-parse HEAD) | |
- name: Upload asset to release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
owner: 'onemen' | |
repo: 'TabMixPlus' | |
tag: 'dev-build' | |
draft: false | |
prerelease: true | |
makeLatest: 'legacy' | |
name: 'Development Build' | |
body: 'This release includes an XPI file that is automatically generated after each push to the main branch.' | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
omitPrereleaseDuringUpdate: true | |
replacesArtifacts: true | |
artifacts: ${{ env.XPI_NAME }}.xpi |